From f67ff54403576ed37a7319e63390b30eab29d7cf Mon Sep 17 00:00:00 2001 From: Dom Harris Date: Sun, 10 Jan 2021 14:56:55 +0000 Subject: [PATCH 1/6] no more spin --- Assets/Materials/Bullet.mat | 2 +- Assets/Scenes/Chief's Sandbox.unity | 6 +++--- Assets/Scripts/EnemyAppearBehaviour.cs | 9 +-------- Assets/Weapons/PlayerWeapon.asset | 7 ++++--- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Assets/Materials/Bullet.mat b/Assets/Materials/Bullet.mat index 8b07143..ccc79f5 100644 --- a/Assets/Materials/Bullet.mat +++ b/Assets/Materials/Bullet.mat @@ -65,7 +65,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _NoiseMap: - m_Texture: {fileID: 0} + m_Texture: {fileID: 2800000, guid: 32d99a4d1161f0f4ca4fca2997778b37, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: diff --git a/Assets/Scenes/Chief's Sandbox.unity b/Assets/Scenes/Chief's Sandbox.unity index f48f960..2d0a048 100644 --- a/Assets/Scenes/Chief's Sandbox.unity +++ b/Assets/Scenes/Chief's Sandbox.unity @@ -506,7 +506,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3397488660842926093, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} propertyPath: m_LocalScale.x - value: 1759.5208 + value: 1492.1846 objectReference: {fileID: 0} - target: {fileID: 3397488660842926093, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} propertyPath: m_LocalScale.y @@ -898,7 +898,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1222495242} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -0.62, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1173812008} @@ -947,7 +947,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 9463c7c973b354f1c882567f52337aed, type: 3} m_Name: m_EditorClassIdentifier: - numObjects: 3000 + numObjects: 500 prefab: {fileID: 1738226812227614580, guid: e084e082567284f79a41423c4fe1adab, type: 3} numToSpawnPerFrame: 10 --- !u!1 &1581716069 diff --git a/Assets/Scripts/EnemyAppearBehaviour.cs b/Assets/Scripts/EnemyAppearBehaviour.cs index 668d39d..c8e4da6 100644 --- a/Assets/Scripts/EnemyAppearBehaviour.cs +++ b/Assets/Scripts/EnemyAppearBehaviour.cs @@ -5,21 +5,14 @@ using UnityEngine; [CreateAssetMenu] public class EnemyAppearBehaviour : BaseBulletBehaviour { - [SerializeField] private float zPos = 50f; - [SerializeField] private float moveInDuration = 0.5f; [SerializeField] private float scaleUpDuration = 0.3f; [SerializeField] private float scaleUpDelay = 0.2f; - [SerializeField] private float moveOutPos = -15f; - [SerializeField] private float moveOutDuration = 2f; public override void DoBehaviour(Transform bullet, float size, Vector3 pos) { bullet.localScale = Vector3.zero; - bullet.localPosition = new Vector3(pos.x, pos.y, zPos); + bullet.localPosition = pos; DOTween.Sequence() - //.Append(bullet.DOMove(pos, moveInDuration).SetEase(Ease.OutQuint)) - .Insert(scaleUpDelay, bullet.DORotate(new Vector3(0,0,45), moveInDuration/2f)) - .Insert(scaleUpDelay + moveInDuration/2f, bullet.DORotate(Vector3.zero, moveInDuration/2f)) .Insert(scaleUpDelay, bullet.DOScale(Vector3.one * size, scaleUpDuration).SetEase(Ease.OutQuint)); } } \ No newline at end of file diff --git a/Assets/Weapons/PlayerWeapon.asset b/Assets/Weapons/PlayerWeapon.asset index 4fb4b4d..9eb67b3 100644 --- a/Assets/Weapons/PlayerWeapon.asset +++ b/Assets/Weapons/PlayerWeapon.asset @@ -104,12 +104,13 @@ MonoBehaviour: collidesWith: serializedVersion: 2 m_Bits: 128 - accuracy: 5 + accuracy: 2 zone: numToSpawn: 1 - offset: {x: 0, y: 0} - spawnType: 2 + offset: {x: 0, y: 0, z: 0} + spawnType: 0 spawnDir: 0 + spawnPlane: 1 width: 0 height: 0 surfaceOnly: 1 From c9f00f2f030864ed8b2676d4470af370bc0be8ac Mon Sep 17 00:00:00 2001 From: Dom Harris Date: Sun, 10 Jan 2021 15:20:28 +0000 Subject: [PATCH 2/6] =?UTF-8?q?fixa=20the=20bullet=20spawning=20and=20make?= =?UTF-8?q?=20it=20Cool=20and=20Fun=E2=84=A2=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Prefabs/Bullet.prefab | 2 +- Assets/Scenes/Chief's Sandbox.unity | 8 ++++---- Assets/Scripts/BeatSpawner.cs | 18 +++++++----------- Assets/Scripts/EnemyAppearBehaviour.cs | 12 ++++++++---- Assets/Scripts/Weapon.cs | 4 ++-- Assets/Weapons/Enemy.asset | 10 +++++----- Assets/Weapons/PlayerWeapon.asset | 14 +++++++------- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Assets/Prefabs/Bullet.prefab b/Assets/Prefabs/Bullet.prefab index 88db7d1..5fd6eaf 100644 --- a/Assets/Prefabs/Bullet.prefab +++ b/Assets/Prefabs/Bullet.prefab @@ -26,7 +26,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1738226812227614583} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1726.4172, y: 488.75378, z: 274.96027} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} diff --git a/Assets/Scenes/Chief's Sandbox.unity b/Assets/Scenes/Chief's Sandbox.unity index 2d0a048..ea0ce81 100644 --- a/Assets/Scenes/Chief's Sandbox.unity +++ b/Assets/Scenes/Chief's Sandbox.unity @@ -234,7 +234,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 186457103} m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} - m_LocalPosition: {x: 0, y: -2, z: 30} + m_LocalPosition: {x: 0, y: -2, z: 100} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -274,9 +274,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4f8399031f014bee928b07d26fe8ee4c, type: 3} m_Name: m_EditorClassIdentifier: - pauseOnBeat: 16 - pauseLengthInBeats: 0 - beatOffset: 2 + spawnOnBeat: 1 + xMin: -5 + xMax: 5 --- !u!114 &531937975 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 5076175860835241000, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} diff --git a/Assets/Scripts/BeatSpawner.cs b/Assets/Scripts/BeatSpawner.cs index c42614f..6ca18f7 100644 --- a/Assets/Scripts/BeatSpawner.cs +++ b/Assets/Scripts/BeatSpawner.cs @@ -1,17 +1,17 @@ using System; using UnityEngine; using UnityEngine.Scripting; +using Random = UnityEngine.Random; public class BeatSpawner : ShootInputBase { - [SerializeField] private int pauseOnBeat; - [SerializeField] private int pauseLengthInBeats; - [SerializeField] private int beatOffset; + [SerializeField] private int spawnOnBeat = 2; + [SerializeField] private float xMin = -10; + [SerializeField] private float xMax = 10; private AudioBeatManager _audio; private bool _shoot; - private bool _isPaused = false; private void Awake() { @@ -20,13 +20,9 @@ public class BeatSpawner : ShootInputBase public void OnBeat(int beat) { - if ((beat + beatOffset) % pauseOnBeat == 0) - _isPaused = true; - - if ((beat + beatOffset + pauseLengthInBeats) % pauseOnBeat == 0) - _isPaused = false; - - _shoot = !_isPaused; + _shoot = beat % spawnOnBeat == 0; + if (_shoot) + transform.position = new Vector3(Random.Range(xMin, xMax), transform.position.y, transform.position.z); } public override bool IsShooting() diff --git a/Assets/Scripts/EnemyAppearBehaviour.cs b/Assets/Scripts/EnemyAppearBehaviour.cs index c8e4da6..d4e04a1 100644 --- a/Assets/Scripts/EnemyAppearBehaviour.cs +++ b/Assets/Scripts/EnemyAppearBehaviour.cs @@ -5,14 +5,18 @@ using UnityEngine; [CreateAssetMenu] public class EnemyAppearBehaviour : BaseBulletBehaviour { - [SerializeField] private float scaleUpDuration = 0.3f; - [SerializeField] private float scaleUpDelay = 0.2f; + [SerializeField] private float scaleUpOverBeats = 1; + private static AudioBeatManager _audio; + public override void DoBehaviour(Transform bullet, float size, Vector3 pos) { + if (_audio == null) + _audio = FindObjectOfType(); + bullet.localScale = Vector3.zero; bullet.localPosition = pos; - DOTween.Sequence() - .Insert(scaleUpDelay, bullet.DOScale(Vector3.one * size, scaleUpDuration).SetEase(Ease.OutQuint)); + + bullet.DOScale(Vector3.one * size, _audio.TimeBetweenBeats * scaleUpOverBeats).SetEase(Ease.OutQuint); } } \ No newline at end of file diff --git a/Assets/Scripts/Weapon.cs b/Assets/Scripts/Weapon.cs index e7c94c9..097171e 100644 --- a/Assets/Scripts/Weapon.cs +++ b/Assets/Scripts/Weapon.cs @@ -256,8 +256,8 @@ public class Weapon : ScriptableObject { var b = _bulletTransforms[i]; if (b == null) continue; - Gizmos.DrawSphere(b.position, b.localScale.x/2f * bulletSize.EvaluateMinMaxCurve()); - Gizmos.DrawSphere(_bullets[i].PrevPos, b.localScale.x/2f * bulletSize.EvaluateMinMaxCurve()); + Gizmos.DrawSphere(b.position, b.localScale.x/2f ); + Gizmos.DrawSphere(_bullets[i].PrevPos, b.localScale.x/2f ); Gizmos.DrawLine(b.position, _bullets[i].PrevPos); } diff --git a/Assets/Weapons/Enemy.asset b/Assets/Weapons/Enemy.asset index 8ae942c..a6d8824 100644 --- a/Assets/Weapons/Enemy.asset +++ b/Assets/Weapons/Enemy.asset @@ -108,17 +108,17 @@ MonoBehaviour: zone: numToSpawn: 10 offset: {x: 0, y: 0, z: 0} - spawnType: 0 + spawnType: 2 spawnDir: 0 spawnPlane: 1 width: 0 height: 0 - surfaceOnly: 0 + surfaceOnly: 1 evenDistribution: 0 - numSides: 5 - numPerSide: 10 + numSides: 3 + numPerSide: 5 flipVertical: 0 - radius: 10 + radius: 5 arc: 360 composite: [] manualFire: 1 diff --git a/Assets/Weapons/PlayerWeapon.asset b/Assets/Weapons/PlayerWeapon.asset index 9eb67b3..5f26453 100644 --- a/Assets/Weapons/PlayerWeapon.asset +++ b/Assets/Weapons/PlayerWeapon.asset @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2bc932693ed0a470d9cf39b1c3168afb, type: 3} m_Name: PlayerWeapon m_EditorClassIdentifier: - fireRate: 0.05 + fireRate: 0.025 bulletSpeed: m_Mode: 0 m_CurveMultiplier: 1 @@ -106,20 +106,20 @@ MonoBehaviour: m_Bits: 128 accuracy: 2 zone: - numToSpawn: 1 + numToSpawn: 2 offset: {x: 0, y: 0, z: 0} - spawnType: 0 + spawnType: 1 spawnDir: 0 spawnPlane: 1 - width: 0 + width: 1.5 height: 0 surfaceOnly: 1 evenDistribution: 1 - numSides: 3 + numSides: 2 numPerSide: 5 flipVertical: 1 - radius: 1.25 - arc: 360 + radius: 5.47 + arc: 82 composite: [] manualFire: 0 behaviour: {fileID: 11400000, guid: 20de5bc0e86bc4037a85f6c46356a227, type: 2} From 01607da25ea0725252b5b4300cfe12c7c655ce0f Mon Sep 17 00:00:00 2001 From: Dom Harris Date: Sun, 10 Jan 2021 16:51:34 +0000 Subject: [PATCH 3/6] Boppin score UI --- Assets/.DS_Store | Bin 6148 -> 6148 bytes .../lemon_milk/LEMONMILK-Regular SDF.asset | 2 +- Assets/Images.meta | 8 - Assets/Images/crosshairs64.png | 3 - Assets/Images/crosshairs64.png.meta | 1680 ----------------- Assets/Scenes/Chief's Sandbox.unity | 251 ++- Assets/Scripts/BeatSpawner.cs | 2 +- Assets/Scripts/DisableOnDeath.cs | 24 +- Assets/Scripts/ScaleWithTime.cs | 29 + Assets/Scripts/ScaleWithTime.cs.meta | 11 + Assets/Scripts/VertexJitter.cs | 175 ++ Assets/Scripts/VertexJitter.cs.meta | 12 + Assets/Scripts/VertexShakeA.cs | 161 ++ Assets/Scripts/VertexShakeA.cs.meta | 12 + Assets/Scripts/VertexShakeB.cs | 185 ++ Assets/Scripts/VertexShakeB.cs.meta | 12 + Assets/Scripts/VertexZoom.cs | 192 ++ Assets/Scripts/VertexZoom.cs.meta | 12 + .../Shaders/TMP_SDF Overlay.shader | 3 +- Assets/Weapons/Enemy.asset | 2 +- 20 files changed, 1068 insertions(+), 1708 deletions(-) delete mode 100644 Assets/Images.meta delete mode 100644 Assets/Images/crosshairs64.png delete mode 100644 Assets/Images/crosshairs64.png.meta create mode 100644 Assets/Scripts/ScaleWithTime.cs create mode 100644 Assets/Scripts/ScaleWithTime.cs.meta create mode 100755 Assets/Scripts/VertexJitter.cs create mode 100755 Assets/Scripts/VertexJitter.cs.meta create mode 100755 Assets/Scripts/VertexShakeA.cs create mode 100755 Assets/Scripts/VertexShakeA.cs.meta create mode 100755 Assets/Scripts/VertexShakeB.cs create mode 100755 Assets/Scripts/VertexShakeB.cs.meta create mode 100755 Assets/Scripts/VertexZoom.cs create mode 100755 Assets/Scripts/VertexZoom.cs.meta diff --git a/Assets/.DS_Store b/Assets/.DS_Store index 5a58b16d2d2a2786c5be3159e79d1bd55ad92316..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 100644 GIT binary patch delta 70 zcmZoMXfc=|#>AjHu~2NHo+1YW5HK<@2yAv_KE|>+fcX{EW_AvK4xj>{$am(+{342+ UKzW7)kiy9(Jj$D6L{=~Z044qo@Bjb+ delta 385 zcmZoMXfc=|#>B)qF;Q%yo}wrd0|Nsi1A_nqLn=dYQh9MfQcix-#>C}}^&lBG22X}u zhD3&RWLcp2*QA1+%;FLQgBy%Y%q*;I>>Qk2+??Ee+?=t&8TsYGC5a`a#ZHMu@d7fz znJKABiACX=DJ2;psd=tBsb#5o{zX2CC8Zkc>L^s3n;YmTm>8SY)^c)iNUFO9#g#Vo&6>Sr>9XaA4uf?uFapDafx!TX z1t9`(@(7TH5+r58MR_^-dFeoL#*K;RSSA~Yux#e$;N}1Z@W#aN%#-;=6j?z5sW914 LM0#_8$QEV*Rr6>5 diff --git a/Assets/Fonts/lemon_milk/LEMONMILK-Regular SDF.asset b/Assets/Fonts/lemon_milk/LEMONMILK-Regular SDF.asset index eafb2f9..5323022 100644 --- a/Assets/Fonts/lemon_milk/LEMONMILK-Regular SDF.asset +++ b/Assets/Fonts/lemon_milk/LEMONMILK-Regular SDF.asset @@ -55,7 +55,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: LEMONMILK-Regular SDF Material - m_Shader: {fileID: 4800000, guid: 68e6db2ebdc24f95958faec2be5558d6, type: 3} + m_Shader: {fileID: 4800000, guid: dd89cf5b9246416f84610a006f916af7, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 diff --git a/Assets/Images.meta b/Assets/Images.meta deleted file mode 100644 index 817a098..0000000 --- a/Assets/Images.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a626c4196d1da4a9197aabfe96a37078 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Images/crosshairs64.png b/Assets/Images/crosshairs64.png deleted file mode 100644 index 91242f4..0000000 --- a/Assets/Images/crosshairs64.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5ac984475928a2c951091af661b6e2e22a5698a25bc2e24fb3bedd40f30c6069 -size 35195 diff --git a/Assets/Images/crosshairs64.png.meta b/Assets/Images/crosshairs64.png.meta deleted file mode 100644 index 2bacd05..0000000 --- a/Assets/Images/crosshairs64.png.meta +++ /dev/null @@ -1,1680 +0,0 @@ -fileFormatVersion: 2 -guid: 8fd3c31c95b6f42ddbe7f923aa74992e -TextureImporter: - internalIDToNameTable: - - first: - 213: 6306658050632196185 - second: crosshairs64_0 - - first: - 213: -3207236822287176621 - second: crosshairs64_1 - - first: - 213: 2952475408694990368 - second: crosshairs64_2 - - first: - 213: 8063117908576333087 - second: crosshairs64_3 - - first: - 213: 5704805819143090384 - second: crosshairs64_4 - - first: - 213: -3003432221690862243 - second: crosshairs64_5 - - first: - 213: -230030023181497484 - second: crosshairs64_6 - - first: - 213: -8785547897371829847 - second: crosshairs64_7 - - first: - 213: -8058495108266584115 - second: crosshairs64_8 - - first: - 213: 5270259550388422492 - second: crosshairs64_9 - - first: - 213: -2185857081015659025 - second: crosshairs64_10 - - first: - 213: -5228675815425978455 - second: crosshairs64_11 - - first: - 213: -4853396300488217227 - second: crosshairs64_12 - - first: - 213: -499657259591991558 - second: crosshairs64_13 - - first: - 213: -8054167844845630135 - second: crosshairs64_14 - - first: - 213: 3072176612330631885 - second: crosshairs64_15 - - first: - 213: 8408591322428169094 - second: crosshairs64_16 - - first: - 213: 9183441386203570020 - second: crosshairs64_17 - - first: - 213: 1329973660212012799 - second: crosshairs64_18 - - first: - 213: -2275066053787641828 - second: crosshairs64_19 - - first: - 213: -5459074835656324813 - second: crosshairs64_20 - - first: - 213: -7583107441173627730 - second: crosshairs64_21 - - first: - 213: 4912455957270990406 - second: crosshairs64_22 - - first: - 213: 3230421270603355048 - second: crosshairs64_23 - - first: - 213: 6842413765209044857 - second: crosshairs64_24 - - first: - 213: -7866789035841366064 - second: crosshairs64_25 - - first: - 213: 5716787406560419972 - second: crosshairs64_26 - - first: - 213: 8220804345321289414 - second: crosshairs64_27 - - first: - 213: 1302701703598660610 - second: crosshairs64_28 - - first: - 213: -7291687782449242445 - second: crosshairs64_29 - - first: - 213: 5617785473291272692 - second: crosshairs64_30 - - first: - 213: 1180089745234162838 - second: crosshairs64_31 - - first: - 213: 3154971605567996937 - second: crosshairs64_32 - - first: - 213: -8853918352464007284 - second: crosshairs64_33 - - first: - 213: 5420206296884627999 - second: crosshairs64_34 - - first: - 213: -3639782272204617949 - second: crosshairs64_35 - - first: - 213: -7815249767767653138 - second: crosshairs64_36 - - first: - 213: 150117454121975427 - second: crosshairs64_37 - - first: - 213: 5792207441326148124 - second: crosshairs64_38 - - first: - 213: 5270710134310834739 - second: crosshairs64_39 - - first: - 213: 9201863267422657251 - second: crosshairs64_40 - - first: - 213: 3738318885906949150 - second: crosshairs64_41 - - first: - 213: -5262488866350825663 - second: crosshairs64_42 - - first: - 213: -5616789029788196407 - second: crosshairs64_43 - - first: - 213: -7729313678460341768 - second: crosshairs64_44 - - first: - 213: 6764268193677610859 - second: crosshairs64_45 - - first: - 213: -7015781733339814737 - second: crosshairs64_46 - - first: - 213: -3409058149369955457 - second: crosshairs64_47 - - first: - 213: 3173639165340601320 - second: crosshairs64_48 - - first: - 213: -6368874459378257250 - second: crosshairs64_49 - - first: - 213: 2398655335923880399 - second: crosshairs64_50 - - first: - 213: 601791599457330555 - second: crosshairs64_51 - - first: - 213: -4374802437259943226 - second: crosshairs64_52 - - first: - 213: 8259582865956434407 - second: crosshairs64_53 - - first: - 213: -1541713431582115134 - second: crosshairs64_54 - - first: - 213: -6307194670947944112 - second: crosshairs64_55 - - first: - 213: 5430277628118554117 - second: crosshairs64_56 - - first: - 213: -1993869676878181351 - second: crosshairs64_57 - - first: - 213: 5330678036248402159 - second: crosshairs64_58 - - first: - 213: 5462929514829369477 - second: crosshairs64_59 - - first: - 213: -4369600851567830412 - second: crosshairs64_60 - - first: - 213: -4674923938913381518 - second: crosshairs64_61 - - first: - 213: -4808689078249601236 - second: crosshairs64_62 - - first: - 213: -4778020575500208806 - second: crosshairs64_63 - externalObjects: {} - serializedVersion: 11 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - vTOnly: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: 2 - aniso: 2 - mipBias: -100 - wrapU: 1 - wrapV: 1 - wrapW: 0 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 2 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 2 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - singleChannelComponent: 0 - flipbookRows: 1 - flipbookColumns: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - ignorePngGamma: 0 - applyGammaDecoding: 0 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 16384 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: Standalone - maxTextureSize: 16384 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: iPhone - maxTextureSize: 16384 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: Android - maxTextureSize: 16384 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: Windows Store Apps - maxTextureSize: 8192 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - spriteSheet: - serializedVersion: 2 - sprites: - - serializedVersion: 2 - name: crosshairs64_0 - rect: - serializedVersion: 2 - x: 0 - y: 448 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 9502acb3510c58750800000000000000 - internalID: 6306658050632196185 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_1 - rect: - serializedVersion: 2 - x: 64 - y: 448 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 35c25015a1b9d73d0800000000000000 - internalID: -3207236822287176621 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_2 - rect: - serializedVersion: 2 - x: 128 - y: 448 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 0265757cdbc49f820800000000000000 - internalID: 2952475408694990368 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_3 - rect: - serializedVersion: 2 - x: 192 - y: 448 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: f1d68c28403f5ef60800000000000000 - internalID: 8063117908576333087 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_4 - rect: - serializedVersion: 2 - x: 256 - y: 448 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 0d0fa9acaaa8b2f40800000000000000 - internalID: 5704805819143090384 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_5 - rect: - serializedVersion: 2 - x: 320 - y: 448 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: d556727ae4aa156d0800000000000000 - internalID: -3003432221690862243 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_6 - rect: - serializedVersion: 2 - x: 384 - y: 448 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 47b8794a9e4ceccf0800000000000000 - internalID: -230030023181497484 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_7 - rect: - serializedVersion: 2 - x: 448 - y: 448 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 9a9d8f33cb6731680800000000000000 - internalID: -8785547897371829847 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_8 - rect: - serializedVersion: 2 - x: 0 - y: 384 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: dc71c8f05697a2090800000000000000 - internalID: -8058495108266584115 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_9 - rect: - serializedVersion: 2 - x: 64 - y: 384 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: c5703075329b32940800000000000000 - internalID: 5270259550388422492 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_10 - rect: - serializedVersion: 2 - x: 128 - y: 384 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: fe51a44e0964aa1e0800000000000000 - internalID: -2185857081015659025 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_11 - rect: - serializedVersion: 2 - x: 192 - y: 384 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 9afcbdf6c030077b0800000000000000 - internalID: -5228675815425978455 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_12 - rect: - serializedVersion: 2 - x: 256 - y: 384 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 57d643377c545acb0800000000000000 - internalID: -4853396300488217227 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_13 - rect: - serializedVersion: 2 - x: 320 - y: 384 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: afef294ae5cd019f0800000000000000 - internalID: -499657259591991558 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_14 - rect: - serializedVersion: 2 - x: 384 - y: 384 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 94d4a969409d93090800000000000000 - internalID: -8054167844845630135 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_15 - rect: - serializedVersion: 2 - x: 448 - y: 384 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: dc2fa311a5092aa20800000000000000 - internalID: 3072176612330631885 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_16 - rect: - serializedVersion: 2 - x: 0 - y: 320 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 68b53c2d14151b470800000000000000 - internalID: 8408591322428169094 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_17 - rect: - serializedVersion: 2 - x: 64 - y: 320 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 46fd848e843227f70800000000000000 - internalID: 9183441386203570020 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_18 - rect: - serializedVersion: 2 - x: 128 - y: 320 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: ff620995ff3057210800000000000000 - internalID: 1329973660212012799 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_19 - rect: - serializedVersion: 2 - x: 192 - y: 320 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: c1810775a775d60e0800000000000000 - internalID: -2275066053787641828 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_20 - rect: - serializedVersion: 2 - x: 256 - y: 320 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 3394e624c587d34b0800000000000000 - internalID: -5459074835656324813 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_21 - rect: - serializedVersion: 2 - x: 320 - y: 320 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: eac793395f363c690800000000000000 - internalID: -7583107441173627730 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_22 - rect: - serializedVersion: 2 - x: 384 - y: 320 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 64e83e37aac8c2440800000000000000 - internalID: 4912455957270990406 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_23 - rect: - serializedVersion: 2 - x: 448 - y: 320 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 8a3dd25b703c4dc20800000000000000 - internalID: 3230421270603355048 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_24 - rect: - serializedVersion: 2 - x: 0 - y: 256 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 9773789111325fe50800000000000000 - internalID: 6842413765209044857 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_25 - rect: - serializedVersion: 2 - x: 64 - y: 256 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 0d7dcbb4d0d83d290800000000000000 - internalID: -7866789035841366064 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_26 - rect: - serializedVersion: 2 - x: 128 - y: 256 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 480e5708bdb165f40800000000000000 - internalID: 5716787406560419972 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_27 - rect: - serializedVersion: 2 - x: 192 - y: 256 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 6c6fcd21ff9261270800000000000000 - internalID: 8220804345321289414 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_28 - rect: - serializedVersion: 2 - x: 256 - y: 256 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 20c5b432c40241210800000000000000 - internalID: 1302701703598660610 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_29 - rect: - serializedVersion: 2 - x: 320 - y: 256 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 3be9e0a4898beca90800000000000000 - internalID: -7291687782449242445 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_30 - rect: - serializedVersion: 2 - x: 384 - y: 256 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 4f140e7af1266fd40800000000000000 - internalID: 5617785473291272692 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_31 - rect: - serializedVersion: 2 - x: 448 - y: 256 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 69473c3fe55806010800000000000000 - internalID: 1180089745234162838 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_32 - rect: - serializedVersion: 2 - x: 0 - y: 192 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 9040352a5f5b8cb20800000000000000 - internalID: 3154971605567996937 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_33 - rect: - serializedVersion: 2 - x: 64 - y: 192 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: c8f22132b20902580800000000000000 - internalID: -8853918352464007284 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_34 - rect: - serializedVersion: 2 - x: 128 - y: 192 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: f1ac427d8e0783b40800000000000000 - internalID: 5420206296884627999 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_35 - rect: - serializedVersion: 2 - x: 192 - y: 192 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 327ca7dce45ec7dc0800000000000000 - internalID: -3639782272204617949 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_36 - rect: - serializedVersion: 2 - x: 256 - y: 192 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: ee441414eb7aa8390800000000000000 - internalID: -7815249767767653138 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_37 - rect: - serializedVersion: 2 - x: 320 - y: 192 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 38eb6877703551200800000000000000 - internalID: 150117454121975427 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_38 - rect: - serializedVersion: 2 - x: 384 - y: 192 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: c1a8e9dbafd026050800000000000000 - internalID: 5792207441326148124 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_39 - rect: - serializedVersion: 2 - x: 448 - y: 192 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 33216a511f2552940800000000000000 - internalID: 5270710134310834739 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_40 - rect: - serializedVersion: 2 - x: 0 - y: 128 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 3ea517e53e593bf70800000000000000 - internalID: 9201863267422657251 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_41 - rect: - serializedVersion: 2 - x: 64 - y: 128 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: e142e93683d21e330800000000000000 - internalID: 3738318885906949150 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_42 - rect: - serializedVersion: 2 - x: 128 - y: 128 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 14ff5b60242e7f6b0800000000000000 - internalID: -5262488866350825663 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_43 - rect: - serializedVersion: 2 - x: 192 - y: 128 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 9c1e92de2282d02b0800000000000000 - internalID: -5616789029788196407 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_44 - rect: - serializedVersion: 2 - x: 256 - y: 128 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 8f1bdcd3926fbb490800000000000000 - internalID: -7729313678460341768 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_45 - rect: - serializedVersion: 2 - x: 320 - y: 128 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: b6f80a165128fdd50800000000000000 - internalID: 6764268193677610859 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_46 - rect: - serializedVersion: 2 - x: 384 - y: 128 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: fa42b9a4fafe2ae90800000000000000 - internalID: -7015781733339814737 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_47 - rect: - serializedVersion: 2 - x: 448 - y: 128 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: f7b3724dca790b0d0800000000000000 - internalID: -3409058149369955457 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_48 - rect: - serializedVersion: 2 - x: 0 - y: 64 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 8ebc46791080b0c20800000000000000 - internalID: 3173639165340601320 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_49 - rect: - serializedVersion: 2 - x: 64 - y: 64 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: e9273b54c663d97a0800000000000000 - internalID: -6368874459378257250 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_50 - rect: - serializedVersion: 2 - x: 128 - y: 64 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: fc19654c15cb94120800000000000000 - internalID: 2398655335923880399 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_51 - rect: - serializedVersion: 2 - x: 192 - y: 64 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: b75e772754ef95800800000000000000 - internalID: 601791599457330555 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_52 - rect: - serializedVersion: 2 - x: 256 - y: 64 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 6c2ab9cac549943c0800000000000000 - internalID: -4374802437259943226 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_53 - rect: - serializedVersion: 2 - x: 320 - y: 64 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 7e17c3efadeef9270800000000000000 - internalID: 8259582865956434407 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_54 - rect: - serializedVersion: 2 - x: 384 - y: 64 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 2ca79156dcbba9ae0800000000000000 - internalID: -1541713431582115134 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_55 - rect: - serializedVersion: 2 - x: 448 - y: 64 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 05939ec1dd75878a0800000000000000 - internalID: -6307194670947944112 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_56 - rect: - serializedVersion: 2 - x: 0 - y: 0 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 506d1cf5bb83c5b40800000000000000 - internalID: 5430277628118554117 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_57 - rect: - serializedVersion: 2 - x: 64 - y: 0 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 91cc045c71a5454e0800000000000000 - internalID: -1993869676878181351 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_58 - rect: - serializedVersion: 2 - x: 128 - y: 0 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: fe8109a4e6f5af940800000000000000 - internalID: 5330678036248402159 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_59 - rect: - serializedVersion: 2 - x: 192 - y: 0 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 580d66c237930db40800000000000000 - internalID: 5462929514829369477 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_60 - rect: - serializedVersion: 2 - x: 256 - y: 0 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 47a1e083d2f0c53c0800000000000000 - internalID: -4369600851567830412 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_61 - rect: - serializedVersion: 2 - x: 320 - y: 0 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: 273191542755f1fb0800000000000000 - internalID: -4674923938913381518 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_62 - rect: - serializedVersion: 2 - x: 384 - y: 0 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: c27c1a7c2ca144db0800000000000000 - internalID: -4808689078249601236 - vertices: [] - indices: - edges: [] - weights: [] - - serializedVersion: 2 - name: crosshairs64_63 - rect: - serializedVersion: 2 - x: 448 - y: 0 - width: 64 - height: 64 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - outline: [] - physicsShape: [] - tessellationDetail: 0 - bones: [] - spriteID: a557dc30a9f01bdb0800000000000000 - internalID: -4778020575500208806 - vertices: [] - indices: - edges: [] - weights: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: 7301cdc73e21a46ab9263c2534d65d8a - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scenes/Chief's Sandbox.unity b/Assets/Scenes/Chief's Sandbox.unity index ea0ce81..870a536 100644 --- a/Assets/Scenes/Chief's Sandbox.unity +++ b/Assets/Scenes/Chief's Sandbox.unity @@ -288,6 +288,106 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3147f962613cca54f8a0b78929a2854b, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &726912288 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 726912292} + - component: {fileID: 726912291} + - component: {fileID: 726912290} + - component: {fileID: 726912289} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &726912289 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 726912288} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &726912290 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 726912288} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &726912291 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 726912288} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &726912292 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 726912288} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1330494722} + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} --- !u!1 &728836291 GameObject: m_ObjectHideFlags: 0 @@ -534,7 +634,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3397488660859550701, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} propertyPath: m_LocalPosition.y - value: 9.773619 + value: 8.773619 objectReference: {fileID: 0} - target: {fileID: 3397488660859550701, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} propertyPath: m_LocalPosition.z @@ -904,6 +1004,155 @@ Transform: m_Father: {fileID: 1173812008} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1330494721 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1330494722} + - component: {fileID: 1330494724} + - component: {fileID: 1330494723} + - component: {fileID: 1330494726} + m_Layer: 5 + m_Name: Score + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1330494722 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1330494721} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 726912292} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -30} + m_SizeDelta: {x: 0, y: 50} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &1330494723 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1330494721} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 1,234,567,898,765,432 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 0f0f54895994248b0bf34c4b4d27beef, type: 2} + m_sharedMaterial: {fileID: -3347474280721358513, guid: 0f0f54895994248b0bf34c4b4d27beef, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 48 + m_fontSizeBase: 48 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 8192 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 1 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1330494724 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1330494721} + m_CullTransparentMesh: 1 +--- !u!114 &1330494726 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1330494721} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45e7636ea714949cd8358ebe56fef05f, type: 3} + m_Name: + m_EditorClassIdentifier: + timeSince: {fileID: 11400000, guid: 8f05f93192443bc42b8523048bde0dc4, type: 2} + scale: 0.25 --- !u!1 &1395215960 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/BeatSpawner.cs b/Assets/Scripts/BeatSpawner.cs index 6ca18f7..1ea9a5c 100644 --- a/Assets/Scripts/BeatSpawner.cs +++ b/Assets/Scripts/BeatSpawner.cs @@ -22,7 +22,7 @@ public class BeatSpawner : ShootInputBase { _shoot = beat % spawnOnBeat == 0; if (_shoot) - transform.position = new Vector3(Random.Range(xMin, xMax), transform.position.y, transform.position.z); + transform.position = new Vector3(Mathf.Lerp(xMin, xMax, Mathf.Sin(beat)), transform.position.y, transform.position.z); } public override bool IsShooting() diff --git a/Assets/Scripts/DisableOnDeath.cs b/Assets/Scripts/DisableOnDeath.cs index 320238f..19574fb 100644 --- a/Assets/Scripts/DisableOnDeath.cs +++ b/Assets/Scripts/DisableOnDeath.cs @@ -10,6 +10,9 @@ public class DisableOnDeath : MonoBehaviour private Color _color1; private Color _color2; + private static readonly int Color1 = Shader.PropertyToID(COLOR_1); + private static readonly int Color2 = Shader.PropertyToID(COLOR_2); + private static readonly int Alpha = Shader.PropertyToID("_Alpha"); private const string COLOR_1 = "_Color1"; private const string COLOR_2 = "_Color2"; @@ -19,16 +22,16 @@ public class DisableOnDeath : MonoBehaviour _health = GetComponent(); _renderer = GetComponentInChildren(); - _color1 = _renderer.material.GetColor(COLOR_1); - _color2 = _renderer.material.GetColor(COLOR_2); + _color1 = _renderer.material.GetColor(Color1); + _color2 = _renderer.material.GetColor(Color2); } private void OnEnable() { _health.Die += Die; - _renderer.material.SetColor(COLOR_1, _color1); - _renderer.material.SetColor(COLOR_2, _color2); + _renderer.material.SetColor(Color1, _color1); + _renderer.material.SetColor(Color2, _color2); } private void OnDisable() @@ -49,19 +52,16 @@ public class DisableOnDeath : MonoBehaviour var c1 = Color.Lerp(_color1, Color.white, t); var c2 = Color.Lerp(_color2, Color.white, t); - _renderer.material.SetColor(COLOR_1, c1); - _renderer.material.SetColor(COLOR_2, c2); - _renderer.material.SetFloat("_Alpha", 1.0f-t); + _renderer.material.SetColor(Color1, c1); + _renderer.material.SetColor(Color2, c2); + _renderer.material.SetFloat(Alpha, 1.0f-t); }, 1.0f, - 0.1f); + 0.05f); - // _renderer.material.DOColor(Color.white, COLOR_1, 0.1f); - // _renderer.material.DOColor(Color.white, COLOR_2, 0.1f); - // _renderer.material.DOFade(0, 0.1f).SetDelay(0.2f); - transform.DOScale(Vector3.one * 1.5f, 0.3f).SetEase(Ease.OutQuint).OnComplete(() => + transform.DOScale(Vector3.one * 1.5f, 0.15f).SetEase(Ease.OutQuint).OnComplete(() => { gameObject.name = oldName; gameObject.SetActive(false); diff --git a/Assets/Scripts/ScaleWithTime.cs b/Assets/Scripts/ScaleWithTime.cs new file mode 100644 index 0000000..f75a376 --- /dev/null +++ b/Assets/Scripts/ScaleWithTime.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using Ktyl.Util; +using TMPro; +using UnityEngine; + +public class ScaleWithTime : MonoBehaviour +{ + [SerializeField] private SerialFloat timeSince; + + [SerializeField] private float scale = 1.5f; + [SerializeField] private float ySquish = -0.15f; + [SerializeField] private float characterSpacing = 10f; + + private TextMeshProUGUI _text; + + private void Awake() + { + _text = GetComponent(); + } + + // Update is called once per frame + void Update() + { + _text.characterSpacing = timeSince * timeSince * characterSpacing; + transform.localScale = new Vector3(1 + timeSince*timeSince * scale, 1 + timeSince*timeSince * ySquish, 1); + } +} diff --git a/Assets/Scripts/ScaleWithTime.cs.meta b/Assets/Scripts/ScaleWithTime.cs.meta new file mode 100644 index 0000000..3674406 --- /dev/null +++ b/Assets/Scripts/ScaleWithTime.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 45e7636ea714949cd8358ebe56fef05f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/VertexJitter.cs b/Assets/Scripts/VertexJitter.cs new file mode 100755 index 0000000..7ed8230 --- /dev/null +++ b/Assets/Scripts/VertexJitter.cs @@ -0,0 +1,175 @@ +using UnityEngine; +using System.Collections; + + +namespace TMPro.Examples +{ + + public class VertexJitter : MonoBehaviour + { + + public float AngleMultiplier = 1.0f; + public float SpeedMultiplier = 1.0f; + public float CurveScale = 1.0f; + + private TMP_Text m_TextComponent; + private bool hasTextChanged; + + /// + /// Structure to hold pre-computed animation data. + /// + private struct VertexAnim + { + public float angleRange; + public float angle; + public float speed; + } + + void Awake() + { + m_TextComponent = GetComponent(); + } + + void OnEnable() + { + // Subscribe to event fired when text object has been regenerated. + TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED); + } + + void OnDisable() + { + TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED); + } + + + void Start() + { + StartCoroutine(AnimateVertexColors()); + } + + + void ON_TEXT_CHANGED(Object obj) + { + if (obj == m_TextComponent) + hasTextChanged = true; + } + + /// + /// Method to animate vertex colors of a TMP Text object. + /// + /// + IEnumerator AnimateVertexColors() + { + + // We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame. + // Alternatively, we could yield and wait until the end of the frame when the text object will be generated. + m_TextComponent.ForceMeshUpdate(); + + TMP_TextInfo textInfo = m_TextComponent.textInfo; + + Matrix4x4 matrix; + + int loopCount = 0; + hasTextChanged = true; + + // Create an Array which contains pre-computed Angle Ranges and Speeds for a bunch of characters. + VertexAnim[] vertexAnim = new VertexAnim[1024]; + for (int i = 0; i < 1024; i++) + { + vertexAnim[i].angleRange = Random.Range(10f, 25f); + vertexAnim[i].speed = Random.Range(1f, 3f); + } + + // Cache the vertex data of the text object as the Jitter FX is applied to the original position of the characters. + TMP_MeshInfo[] cachedMeshInfo = textInfo.CopyMeshInfoVertexData(); + + while (true) + { + // Get new copy of vertex data if the text has changed. + if (hasTextChanged) + { + // Update the copy of the vertex data for the text object. + cachedMeshInfo = textInfo.CopyMeshInfoVertexData(); + + hasTextChanged = false; + } + + int characterCount = textInfo.characterCount; + + // If No Characters then just yield and wait for some text to be added + if (characterCount == 0) + { + yield return new WaitForSeconds(0.25f); + continue; + } + + + for (int i = 0; i < characterCount; i++) + { + TMP_CharacterInfo charInfo = textInfo.characterInfo[i]; + + // Skip characters that are not visible and thus have no geometry to manipulate. + if (!charInfo.isVisible) + continue; + + // Retrieve the pre-computed animation data for the given character. + VertexAnim vertAnim = vertexAnim[i]; + + // Get the index of the material used by the current character. + int materialIndex = textInfo.characterInfo[i].materialReferenceIndex; + + // Get the index of the first vertex used by this text element. + int vertexIndex = textInfo.characterInfo[i].vertexIndex; + + // Get the cached vertices of the mesh used by this text element (character or sprite). + Vector3[] sourceVertices = cachedMeshInfo[materialIndex].vertices; + + // Determine the center point of each character at the baseline. + //Vector2 charMidBasline = new Vector2((sourceVertices[vertexIndex + 0].x + sourceVertices[vertexIndex + 2].x) / 2, charInfo.baseLine); + // Determine the center point of each character. + Vector2 charMidBasline = (sourceVertices[vertexIndex + 0] + sourceVertices[vertexIndex + 2]) / 2; + + // Need to translate all 4 vertices of each quad to aligned with middle of character / baseline. + // This is needed so the matrix TRS is applied at the origin for each character. + Vector3 offset = charMidBasline; + + Vector3[] destinationVertices = textInfo.meshInfo[materialIndex].vertices; + + destinationVertices[vertexIndex + 0] = sourceVertices[vertexIndex + 0] - offset; + destinationVertices[vertexIndex + 1] = sourceVertices[vertexIndex + 1] - offset; + destinationVertices[vertexIndex + 2] = sourceVertices[vertexIndex + 2] - offset; + destinationVertices[vertexIndex + 3] = sourceVertices[vertexIndex + 3] - offset; + + vertAnim.angle = Mathf.SmoothStep(-vertAnim.angleRange, vertAnim.angleRange, Mathf.PingPong(loopCount / 25f * vertAnim.speed, 1f)); + Vector3 jitterOffset = new Vector3(Random.Range(-.25f, .25f), Random.Range(-.25f, .25f), 0); + + matrix = Matrix4x4.TRS(jitterOffset * CurveScale, Quaternion.Euler(0, 0, Random.Range(-5f, 5f) * AngleMultiplier), Vector3.one); + + destinationVertices[vertexIndex + 0] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 0]); + destinationVertices[vertexIndex + 1] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 1]); + destinationVertices[vertexIndex + 2] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 2]); + destinationVertices[vertexIndex + 3] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 3]); + + destinationVertices[vertexIndex + 0] += offset; + destinationVertices[vertexIndex + 1] += offset; + destinationVertices[vertexIndex + 2] += offset; + destinationVertices[vertexIndex + 3] += offset; + + vertexAnim[i] = vertAnim; + } + + // Push changes into meshes + for (int i = 0; i < textInfo.meshInfo.Length; i++) + { + textInfo.meshInfo[i].mesh.vertices = textInfo.meshInfo[i].vertices; + m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i); + } + + loopCount += 1; + + yield return new WaitForSeconds(0.1f); + } + } + + } +} \ No newline at end of file diff --git a/Assets/Scripts/VertexJitter.cs.meta b/Assets/Scripts/VertexJitter.cs.meta new file mode 100755 index 0000000..2ba768c --- /dev/null +++ b/Assets/Scripts/VertexJitter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2ed57967c52645d390a89dcf8f61ba73 +timeCreated: 1461286718 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/VertexShakeA.cs b/Assets/Scripts/VertexShakeA.cs new file mode 100755 index 0000000..a4022a5 --- /dev/null +++ b/Assets/Scripts/VertexShakeA.cs @@ -0,0 +1,161 @@ +using UnityEngine; +using System.Collections; + + +namespace TMPro.Examples +{ + + public class VertexShakeA : MonoBehaviour + { + + public float AngleMultiplier = 1.0f; + public float SpeedMultiplier = 1.0f; + public float ScaleMultiplier = 1.0f; + public float RotationMultiplier = 1.0f; + + private TMP_Text m_TextComponent; + private bool hasTextChanged; + + + void Awake() + { + m_TextComponent = GetComponent(); + } + + void OnEnable() + { + // Subscribe to event fired when text object has been regenerated. + TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED); + } + + void OnDisable() + { + TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED); + } + + + void Start() + { + StartCoroutine(AnimateVertexColors()); + } + + + void ON_TEXT_CHANGED(Object obj) + { + if (obj = m_TextComponent) + hasTextChanged = true; + } + + /// + /// Method to animate vertex colors of a TMP Text object. + /// + /// + IEnumerator AnimateVertexColors() + { + + // We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame. + // Alternatively, we could yield and wait until the end of the frame when the text object will be generated. + m_TextComponent.ForceMeshUpdate(); + + TMP_TextInfo textInfo = m_TextComponent.textInfo; + + Matrix4x4 matrix; + Vector3[][] copyOfVertices = new Vector3[0][]; + + hasTextChanged = true; + + while (true) + { + // Allocate new vertices + if (hasTextChanged) + { + if (copyOfVertices.Length < textInfo.meshInfo.Length) + copyOfVertices = new Vector3[textInfo.meshInfo.Length][]; + + for (int i = 0; i < textInfo.meshInfo.Length; i++) + { + int length = textInfo.meshInfo[i].vertices.Length; + copyOfVertices[i] = new Vector3[length]; + } + + hasTextChanged = false; + } + + int characterCount = textInfo.characterCount; + + // If No Characters then just yield and wait for some text to be added + if (characterCount == 0) + { + yield return new WaitForSeconds(0.25f); + continue; + } + + int lineCount = textInfo.lineCount; + + // Iterate through each line of the text. + for (int i = 0; i < lineCount; i++) + { + + int first = textInfo.lineInfo[i].firstCharacterIndex; + int last = textInfo.lineInfo[i].lastCharacterIndex; + + // Determine the center of each line + Vector3 centerOfLine = (textInfo.characterInfo[first].bottomLeft + textInfo.characterInfo[last].topRight) / 2; + Quaternion rotation = Quaternion.Euler(0, 0, Random.Range(-0.25f, 0.25f) * RotationMultiplier); + + // Iterate through each character of the line. + for (int j = first; j <= last; j++) + { + // Skip characters that are not visible and thus have no geometry to manipulate. + if (!textInfo.characterInfo[j].isVisible) + continue; + + // Get the index of the material used by the current character. + int materialIndex = textInfo.characterInfo[j].materialReferenceIndex; + + // Get the index of the first vertex used by this text element. + int vertexIndex = textInfo.characterInfo[j].vertexIndex; + + // Get the vertices of the mesh used by this text element (character or sprite). + Vector3[] sourceVertices = textInfo.meshInfo[materialIndex].vertices; + + // Need to translate all 4 vertices of each quad to aligned with center of character. + // This is needed so the matrix TRS is applied at the origin for each character. + copyOfVertices[materialIndex][vertexIndex + 0] = sourceVertices[vertexIndex + 0] - centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 1] = sourceVertices[vertexIndex + 1] - centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 2] = sourceVertices[vertexIndex + 2] - centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 3] = sourceVertices[vertexIndex + 3] - centerOfLine; + + // Determine the random scale change for each character. + float randomScale = Random.Range(0.995f - 0.001f * ScaleMultiplier, 1.005f + 0.001f * ScaleMultiplier); + + // Setup the matrix rotation. + matrix = Matrix4x4.TRS(Vector3.one, rotation, Vector3.one * randomScale); + + // Apply the matrix TRS to the individual characters relative to the center of the current line. + copyOfVertices[materialIndex][vertexIndex + 0] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 0]); + copyOfVertices[materialIndex][vertexIndex + 1] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 1]); + copyOfVertices[materialIndex][vertexIndex + 2] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 2]); + copyOfVertices[materialIndex][vertexIndex + 3] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 3]); + + // Revert the translation change. + copyOfVertices[materialIndex][vertexIndex + 0] += centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 1] += centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 2] += centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 3] += centerOfLine; + } + } + + // Push changes into meshes + for (int i = 0; i < textInfo.meshInfo.Length; i++) + { + textInfo.meshInfo[i].mesh.vertices = copyOfVertices[i]; + m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i); + } + + yield return new WaitForSeconds(0.1f); + } + } + + } +} \ No newline at end of file diff --git a/Assets/Scripts/VertexShakeA.cs.meta b/Assets/Scripts/VertexShakeA.cs.meta new file mode 100755 index 0000000..25aceb5 --- /dev/null +++ b/Assets/Scripts/VertexShakeA.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f7cfa58e417a46ea8889989684c2522e +timeCreated: 1462089320 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/VertexShakeB.cs b/Assets/Scripts/VertexShakeB.cs new file mode 100755 index 0000000..fd3b1c4 --- /dev/null +++ b/Assets/Scripts/VertexShakeB.cs @@ -0,0 +1,185 @@ +using UnityEngine; +using System.Collections; + + +namespace TMPro.Examples +{ + + public class VertexShakeB : MonoBehaviour + { + + public float AngleMultiplier = 1.0f; + public float SpeedMultiplier = 1.0f; + public float CurveScale = 1.0f; + + private TMP_Text m_TextComponent; + private bool hasTextChanged; + + + void Awake() + { + m_TextComponent = GetComponent(); + } + + void OnEnable() + { + // Subscribe to event fired when text object has been regenerated. + TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED); + } + + void OnDisable() + { + TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED); + } + + + void Start() + { + StartCoroutine(AnimateVertexColors()); + } + + + void ON_TEXT_CHANGED(Object obj) + { + if (obj = m_TextComponent) + hasTextChanged = true; + } + + /// + /// Method to animate vertex colors of a TMP Text object. + /// + /// + IEnumerator AnimateVertexColors() + { + + // We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame. + // Alternatively, we could yield and wait until the end of the frame when the text object will be generated. + m_TextComponent.ForceMeshUpdate(); + + TMP_TextInfo textInfo = m_TextComponent.textInfo; + + Matrix4x4 matrix; + Vector3[][] copyOfVertices = new Vector3[0][]; + + hasTextChanged = true; + + while (true) + { + // Allocate new vertices + if (hasTextChanged) + { + if (copyOfVertices.Length < textInfo.meshInfo.Length) + copyOfVertices = new Vector3[textInfo.meshInfo.Length][]; + + for (int i = 0; i < textInfo.meshInfo.Length; i++) + { + int length = textInfo.meshInfo[i].vertices.Length; + copyOfVertices[i] = new Vector3[length]; + } + + hasTextChanged = false; + } + + int characterCount = textInfo.characterCount; + + // If No Characters then just yield and wait for some text to be added + if (characterCount == 0) + { + yield return new WaitForSeconds(0.25f); + continue; + } + + int lineCount = textInfo.lineCount; + + // Iterate through each line of the text. + for (int i = 0; i < lineCount; i++) + { + + int first = textInfo.lineInfo[i].firstCharacterIndex; + int last = textInfo.lineInfo[i].lastCharacterIndex; + + // Determine the center of each line + Vector3 centerOfLine = (textInfo.characterInfo[first].bottomLeft + textInfo.characterInfo[last].topRight) / 2; + Quaternion rotation = Quaternion.Euler(0, 0, Random.Range(-0.25f, 0.25f)); + + // Iterate through each character of the line. + for (int j = first; j <= last; j++) + { + // Skip characters that are not visible and thus have no geometry to manipulate. + if (!textInfo.characterInfo[j].isVisible) + continue; + + // Get the index of the material used by the current character. + int materialIndex = textInfo.characterInfo[j].materialReferenceIndex; + + // Get the index of the first vertex used by this text element. + int vertexIndex = textInfo.characterInfo[j].vertexIndex; + + // Get the vertices of the mesh used by this text element (character or sprite). + Vector3[] sourceVertices = textInfo.meshInfo[materialIndex].vertices; + + // Determine the center point of each character at the baseline. + Vector3 charCenter = (sourceVertices[vertexIndex + 0] + sourceVertices[vertexIndex + 2]) / 2; + + // Need to translate all 4 vertices of each quad to aligned with center of character. + // This is needed so the matrix TRS is applied at the origin for each character. + copyOfVertices[materialIndex][vertexIndex + 0] = sourceVertices[vertexIndex + 0] - charCenter; + copyOfVertices[materialIndex][vertexIndex + 1] = sourceVertices[vertexIndex + 1] - charCenter; + copyOfVertices[materialIndex][vertexIndex + 2] = sourceVertices[vertexIndex + 2] - charCenter; + copyOfVertices[materialIndex][vertexIndex + 3] = sourceVertices[vertexIndex + 3] - charCenter; + + // Determine the random scale change for each character. + float randomScale = Random.Range(0.95f, 1.05f); + + // Setup the matrix for the scale change. + matrix = Matrix4x4.TRS(Vector3.one, Quaternion.identity, Vector3.one * randomScale); + + // Apply the scale change relative to the center of each character. + copyOfVertices[materialIndex][vertexIndex + 0] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 0]); + copyOfVertices[materialIndex][vertexIndex + 1] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 1]); + copyOfVertices[materialIndex][vertexIndex + 2] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 2]); + copyOfVertices[materialIndex][vertexIndex + 3] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 3]); + + // Revert the translation change. + copyOfVertices[materialIndex][vertexIndex + 0] += charCenter; + copyOfVertices[materialIndex][vertexIndex + 1] += charCenter; + copyOfVertices[materialIndex][vertexIndex + 2] += charCenter; + copyOfVertices[materialIndex][vertexIndex + 3] += charCenter; + + // Need to translate all 4 vertices of each quad to aligned with the center of the line. + // This is needed so the matrix TRS is applied from the center of the line. + copyOfVertices[materialIndex][vertexIndex + 0] -= centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 1] -= centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 2] -= centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 3] -= centerOfLine; + + // Setup the matrix rotation. + matrix = Matrix4x4.TRS(Vector3.one, rotation, Vector3.one); + + // Apply the matrix TRS to the individual characters relative to the center of the current line. + copyOfVertices[materialIndex][vertexIndex + 0] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 0]); + copyOfVertices[materialIndex][vertexIndex + 1] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 1]); + copyOfVertices[materialIndex][vertexIndex + 2] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 2]); + copyOfVertices[materialIndex][vertexIndex + 3] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 3]); + + // Revert the translation change. + copyOfVertices[materialIndex][vertexIndex + 0] += centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 1] += centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 2] += centerOfLine; + copyOfVertices[materialIndex][vertexIndex + 3] += centerOfLine; + } + } + + // Push changes into meshes + for (int i = 0; i < textInfo.meshInfo.Length; i++) + { + textInfo.meshInfo[i].mesh.vertices = copyOfVertices[i]; + m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i); + } + + yield return new WaitForSeconds(0.1f); + } + } + + } +} \ No newline at end of file diff --git a/Assets/Scripts/VertexShakeB.cs.meta b/Assets/Scripts/VertexShakeB.cs.meta new file mode 100755 index 0000000..f1fcf32 --- /dev/null +++ b/Assets/Scripts/VertexShakeB.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e4e0d9ccee5f4950be8979268c9014e0 +timeCreated: 1462093319 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/VertexZoom.cs b/Assets/Scripts/VertexZoom.cs new file mode 100755 index 0000000..c4973fb --- /dev/null +++ b/Assets/Scripts/VertexZoom.cs @@ -0,0 +1,192 @@ +using UnityEngine; +using System.Linq; +using System.Collections; +using System.Collections.Generic; + + +namespace TMPro.Examples +{ + + public class VertexZoom : MonoBehaviour + { + public float AngleMultiplier = 1.0f; + public float SpeedMultiplier = 1.0f; + public float CurveScale = 1.0f; + + private TMP_Text m_TextComponent; + private bool hasTextChanged; + + + void Awake() + { + m_TextComponent = GetComponent(); + } + + void OnEnable() + { + // Subscribe to event fired when text object has been regenerated. + TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED); + } + + void OnDisable() + { + // UnSubscribe to event fired when text object has been regenerated. + TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED); + } + + + void Start() + { + StartCoroutine(AnimateVertexColors()); + } + + + void ON_TEXT_CHANGED(Object obj) + { + if (obj == m_TextComponent) + hasTextChanged = true; + } + + /// + /// Method to animate vertex colors of a TMP Text object. + /// + /// + IEnumerator AnimateVertexColors() + { + + // We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame. + // Alternatively, we could yield and wait until the end of the frame when the text object will be generated. + m_TextComponent.ForceMeshUpdate(); + + TMP_TextInfo textInfo = m_TextComponent.textInfo; + + Matrix4x4 matrix; + TMP_MeshInfo[] cachedMeshInfoVertexData = textInfo.CopyMeshInfoVertexData(); + + // Allocations for sorting of the modified scales + List modifiedCharScale = new List(); + List scaleSortingOrder = new List(); + + hasTextChanged = true; + + while (true) + { + // Allocate new vertices + if (hasTextChanged) + { + // Get updated vertex data + cachedMeshInfoVertexData = textInfo.CopyMeshInfoVertexData(); + + hasTextChanged = false; + } + + int characterCount = textInfo.characterCount; + + // If No Characters then just yield and wait for some text to be added + if (characterCount == 0) + { + yield return new WaitForSeconds(0.25f); + continue; + } + + // Clear list of character scales + modifiedCharScale.Clear(); + scaleSortingOrder.Clear(); + + for (int i = 0; i < characterCount; i++) + { + TMP_CharacterInfo charInfo = textInfo.characterInfo[i]; + + // Skip characters that are not visible and thus have no geometry to manipulate. + if (!charInfo.isVisible) + continue; + + // Get the index of the material used by the current character. + int materialIndex = textInfo.characterInfo[i].materialReferenceIndex; + + // Get the index of the first vertex used by this text element. + int vertexIndex = textInfo.characterInfo[i].vertexIndex; + + // Get the cached vertices of the mesh used by this text element (character or sprite). + Vector3[] sourceVertices = cachedMeshInfoVertexData[materialIndex].vertices; + + // Determine the center point of each character at the baseline. + //Vector2 charMidBasline = new Vector2((sourceVertices[vertexIndex + 0].x + sourceVertices[vertexIndex + 2].x) / 2, charInfo.baseLine); + // Determine the center point of each character. + Vector2 charMidBasline = (sourceVertices[vertexIndex + 0] + sourceVertices[vertexIndex + 2]) / 2; + + // Need to translate all 4 vertices of each quad to aligned with middle of character / baseline. + // This is needed so the matrix TRS is applied at the origin for each character. + Vector3 offset = charMidBasline; + + Vector3[] destinationVertices = textInfo.meshInfo[materialIndex].vertices; + + destinationVertices[vertexIndex + 0] = sourceVertices[vertexIndex + 0] - offset; + destinationVertices[vertexIndex + 1] = sourceVertices[vertexIndex + 1] - offset; + destinationVertices[vertexIndex + 2] = sourceVertices[vertexIndex + 2] - offset; + destinationVertices[vertexIndex + 3] = sourceVertices[vertexIndex + 3] - offset; + + //Vector3 jitterOffset = new Vector3(Random.Range(-.25f, .25f), Random.Range(-.25f, .25f), 0); + + // Determine the random scale change for each character. + float randomScale = Random.Range(1f, 1.5f); + + // Add modified scale and index + modifiedCharScale.Add(randomScale); + scaleSortingOrder.Add(modifiedCharScale.Count - 1); + + // Setup the matrix for the scale change. + //matrix = Matrix4x4.TRS(jitterOffset, Quaternion.Euler(0, 0, Random.Range(-5f, 5f)), Vector3.one * randomScale); + matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, Vector3.one * randomScale); + + destinationVertices[vertexIndex + 0] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 0]); + destinationVertices[vertexIndex + 1] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 1]); + destinationVertices[vertexIndex + 2] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 2]); + destinationVertices[vertexIndex + 3] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 3]); + + destinationVertices[vertexIndex + 0] += offset; + destinationVertices[vertexIndex + 1] += offset; + destinationVertices[vertexIndex + 2] += offset; + destinationVertices[vertexIndex + 3] += offset; + + // Restore Source UVS which have been modified by the sorting + Vector2[] sourceUVs0 = cachedMeshInfoVertexData[materialIndex].uvs0; + Vector2[] destinationUVs0 = textInfo.meshInfo[materialIndex].uvs0; + + destinationUVs0[vertexIndex + 0] = sourceUVs0[vertexIndex + 0]; + destinationUVs0[vertexIndex + 1] = sourceUVs0[vertexIndex + 1]; + destinationUVs0[vertexIndex + 2] = sourceUVs0[vertexIndex + 2]; + destinationUVs0[vertexIndex + 3] = sourceUVs0[vertexIndex + 3]; + + // Restore Source Vertex Colors + Color32[] sourceColors32 = cachedMeshInfoVertexData[materialIndex].colors32; + Color32[] destinationColors32 = textInfo.meshInfo[materialIndex].colors32; + + destinationColors32[vertexIndex + 0] = sourceColors32[vertexIndex + 0]; + destinationColors32[vertexIndex + 1] = sourceColors32[vertexIndex + 1]; + destinationColors32[vertexIndex + 2] = sourceColors32[vertexIndex + 2]; + destinationColors32[vertexIndex + 3] = sourceColors32[vertexIndex + 3]; + } + + // Push changes into meshes + for (int i = 0; i < textInfo.meshInfo.Length; i++) + { + //// Sort Quads based modified scale + scaleSortingOrder.Sort((a, b) => modifiedCharScale[a].CompareTo(modifiedCharScale[b])); + + textInfo.meshInfo[i].SortGeometry(scaleSortingOrder); + + // Updated modified vertex attributes + textInfo.meshInfo[i].mesh.vertices = textInfo.meshInfo[i].vertices; + textInfo.meshInfo[i].mesh.uv = textInfo.meshInfo[i].uvs0; + textInfo.meshInfo[i].mesh.colors32 = textInfo.meshInfo[i].colors32; + + m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i); + } + + yield return new WaitForSeconds(0.1f); + } + } + + } +} \ No newline at end of file diff --git a/Assets/Scripts/VertexZoom.cs.meta b/Assets/Scripts/VertexZoom.cs.meta new file mode 100755 index 0000000..d9e3f96 --- /dev/null +++ b/Assets/Scripts/VertexZoom.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 52ec835d14bd486f900952b77698b7eb +timeCreated: 1466280202 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TextMesh Pro/Shaders/TMP_SDF Overlay.shader b/Assets/TextMesh Pro/Shaders/TMP_SDF Overlay.shader index c50c593..6960228 100755 --- a/Assets/TextMesh Pro/Shaders/TMP_SDF Overlay.shader +++ b/Assets/TextMesh Pro/Shaders/TMP_SDF Overlay.shader @@ -107,7 +107,8 @@ SubShader { Lighting Off Fog { Mode Off } ZTest Always - Blend One OneMinusSrcAlpha + Blend OneMinusDstColor OneMinusSrcAlpha + ColorMask [_ColorMask] Pass { diff --git a/Assets/Weapons/Enemy.asset b/Assets/Weapons/Enemy.asset index a6d8824..280a48d 100644 --- a/Assets/Weapons/Enemy.asset +++ b/Assets/Weapons/Enemy.asset @@ -65,7 +65,7 @@ MonoBehaviour: m_PostInfinity: 2 m_RotationOrder: 4 m_ConstantMin: 20 - m_ConstantMax: 30 + m_ConstantMax: 60 bulletLifetime: m_Mode: 0 m_CurveMultiplier: 0 From 99e949cd9b5e05e804349fe979443834cb6cb9c3 Mon Sep 17 00:00:00 2001 From: Dom Harris Date: Sun, 10 Jan 2021 17:15:58 +0000 Subject: [PATCH 4/6] score? Scoregit push --set-upstream origin score-n-shit --- Assets/Prefabs/Enemy.prefab | 16 ++++++++++++++- Assets/Scenes/Chief's Sandbox.unity | 23 ++++++++++++++++++++-- Assets/Scripts/AddScoreOnDie.cs | 29 ++++++++++++++++++++++++++++ Assets/Scripts/AddScoreOnDie.cs.meta | 11 +++++++++++ Assets/Scripts/DisableOnDeath.cs | 6 ++++-- Assets/Scripts/Score.cs | 17 ++++++++++++++++ Assets/Scripts/Score.cs.meta | 3 +++ Assets/Scripts/UpdateScore.cs | 27 ++++++++++++++++++++++++++ Assets/Scripts/UpdateScore.cs.meta | 3 +++ Assets/Weapons/Enemy.asset | 2 +- Assets/Weapons/PlayerWeapon.asset | 4 ++-- 11 files changed, 133 insertions(+), 8 deletions(-) create mode 100644 Assets/Scripts/AddScoreOnDie.cs create mode 100644 Assets/Scripts/AddScoreOnDie.cs.meta create mode 100644 Assets/Scripts/Score.cs create mode 100644 Assets/Scripts/Score.cs.meta create mode 100644 Assets/Scripts/UpdateScore.cs create mode 100644 Assets/Scripts/UpdateScore.cs.meta diff --git a/Assets/Prefabs/Enemy.prefab b/Assets/Prefabs/Enemy.prefab index 3d71938..c81ae66 100644 --- a/Assets/Prefabs/Enemy.prefab +++ b/Assets/Prefabs/Enemy.prefab @@ -14,6 +14,7 @@ GameObject: - component: {fileID: 233269787904781725} - component: {fileID: 2766037370157449026} - component: {fileID: 2122656558574222561} + - component: {fileID: -3971665732303992234} m_Layer: 7 m_Name: Enemy m_TagString: Untagged @@ -109,7 +110,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d77551efeb20a4bdabb517c8351695ff, type: 3} m_Name: m_EditorClassIdentifier: - maxHealth: 1 + maxHealth: 4 --- !u!114 &2122656558574222561 MonoBehaviour: m_ObjectHideFlags: 0 @@ -122,3 +123,16 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5b2c8b098025f4e2f997759b5c00fef7, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &-3971665732303992234 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738226812227614583} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1c18e41c4d38f4467bda24e543fec25f, type: 3} + m_Name: + m_EditorClassIdentifier: + value: 1000 diff --git a/Assets/Scenes/Chief's Sandbox.unity b/Assets/Scenes/Chief's Sandbox.unity index 870a536..4da9374 100644 --- a/Assets/Scenes/Chief's Sandbox.unity +++ b/Assets/Scenes/Chief's Sandbox.unity @@ -234,7 +234,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 186457103} m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} - m_LocalPosition: {x: 0, y: -2, z: 100} + m_LocalPosition: {x: 0, y: -2, z: 200} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -1016,6 +1016,7 @@ GameObject: - component: {fileID: 1330494724} - component: {fileID: 1330494723} - component: {fileID: 1330494726} + - component: {fileID: 1330494725} m_Layer: 5 m_Name: Score m_TagString: Untagged @@ -1062,7 +1063,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: 1,234,567,898,765,432 + m_text: 0 m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 0f0f54895994248b0bf34c4b4d27beef, type: 2} m_sharedMaterial: {fileID: -3347474280721358513, guid: 0f0f54895994248b0bf34c4b4d27beef, type: 2} @@ -1139,6 +1140,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1330494721} m_CullTransparentMesh: 1 +--- !u!114 &1330494725 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1330494721} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3da04f2795dd4afe8551debe01be4561, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &1330494726 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1153,6 +1166,8 @@ MonoBehaviour: m_EditorClassIdentifier: timeSince: {fileID: 11400000, guid: 8f05f93192443bc42b8523048bde0dc4, type: 2} scale: 0.25 + ySquish: -0.15 + characterSpacing: 10 --- !u!1 &1395215960 GameObject: m_ObjectHideFlags: 0 @@ -1406,6 +1421,10 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3} + propertyPath: bpm + value: 90 + objectReference: {fileID: 0} - target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3} propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[0].m_Target value: diff --git a/Assets/Scripts/AddScoreOnDie.cs b/Assets/Scripts/AddScoreOnDie.cs new file mode 100644 index 0000000..63ffe84 --- /dev/null +++ b/Assets/Scripts/AddScoreOnDie.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Weapons.Scripts; + +public class AddScoreOnDie : MonoBehaviour +{ + [SerializeField] private ulong value = 100; + private EntityHealth _health; + private void Awake() + { + _health = GetComponent(); + } + + private void OnEnable() + { + _health.Die += Die; + } + + private void OnDisable() + { + _health.Die -= Die; + } + + private void Die() + { + Score.Value += value + (ulong)Random.Range(-5, 5); + } +} \ No newline at end of file diff --git a/Assets/Scripts/AddScoreOnDie.cs.meta b/Assets/Scripts/AddScoreOnDie.cs.meta new file mode 100644 index 0000000..9f96eae --- /dev/null +++ b/Assets/Scripts/AddScoreOnDie.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1c18e41c4d38f4467bda24e543fec25f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/DisableOnDeath.cs b/Assets/Scripts/DisableOnDeath.cs index 19574fb..9f7567d 100644 --- a/Assets/Scripts/DisableOnDeath.cs +++ b/Assets/Scripts/DisableOnDeath.cs @@ -7,6 +7,7 @@ public class DisableOnDeath : MonoBehaviour { private EntityHealth _health; private Renderer _renderer; + private Collider _collider; private Color _color1; private Color _color2; @@ -21,6 +22,7 @@ public class DisableOnDeath : MonoBehaviour { _health = GetComponent(); _renderer = GetComponentInChildren(); + _collider = GetComponentInChildren(); _color1 = _renderer.material.GetColor(Color1); _color2 = _renderer.material.GetColor(Color2); @@ -29,7 +31,7 @@ public class DisableOnDeath : MonoBehaviour private void OnEnable() { _health.Die += Die; - + _collider.enabled = true; _renderer.material.SetColor(Color1, _color1); _renderer.material.SetColor(Color2, _color2); } @@ -43,7 +45,7 @@ public class DisableOnDeath : MonoBehaviour { var oldName = gameObject.name; gameObject.name = "disabled"; - + _collider.enabled = false; float x = 0; DOTween.To( () => x, diff --git a/Assets/Scripts/Score.cs b/Assets/Scripts/Score.cs new file mode 100644 index 0000000..43dbd58 --- /dev/null +++ b/Assets/Scripts/Score.cs @@ -0,0 +1,17 @@ +using System; + +public static class Score +{ + private static ulong _value; + public static ulong Value + { + get => _value; + set + { + _value = value; + ScoreUpdated?.Invoke(_value); + } + } + + public static event Action ScoreUpdated; +} \ No newline at end of file diff --git a/Assets/Scripts/Score.cs.meta b/Assets/Scripts/Score.cs.meta new file mode 100644 index 0000000..029eaef --- /dev/null +++ b/Assets/Scripts/Score.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 22e5c22e25d5491e9a6fdabcd5788ebf +timeCreated: 1610298027 \ No newline at end of file diff --git a/Assets/Scripts/UpdateScore.cs b/Assets/Scripts/UpdateScore.cs new file mode 100644 index 0000000..b63aa8e --- /dev/null +++ b/Assets/Scripts/UpdateScore.cs @@ -0,0 +1,27 @@ +using TMPro; +using UnityEngine; + +public class UpdateScore : MonoBehaviour +{ + private TextMeshProUGUI _text; + + private void Awake() + { + _text = GetComponent(); + } + + private void OnEnable() + { + Score.ScoreUpdated += OnScoreUpdated; + } + + private void OnDisable() + { + Score.ScoreUpdated -= OnScoreUpdated; + } + + private void OnScoreUpdated(ulong obj) + { + _text.text = $"{obj:n0}"; + } +} \ No newline at end of file diff --git a/Assets/Scripts/UpdateScore.cs.meta b/Assets/Scripts/UpdateScore.cs.meta new file mode 100644 index 0000000..cdaab5c --- /dev/null +++ b/Assets/Scripts/UpdateScore.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3da04f2795dd4afe8551debe01be4561 +timeCreated: 1610298154 \ No newline at end of file diff --git a/Assets/Weapons/Enemy.asset b/Assets/Weapons/Enemy.asset index 280a48d..f33f2a4 100644 --- a/Assets/Weapons/Enemy.asset +++ b/Assets/Weapons/Enemy.asset @@ -116,7 +116,7 @@ MonoBehaviour: surfaceOnly: 1 evenDistribution: 0 numSides: 3 - numPerSide: 5 + numPerSide: 10 flipVertical: 0 radius: 5 arc: 360 diff --git a/Assets/Weapons/PlayerWeapon.asset b/Assets/Weapons/PlayerWeapon.asset index 5f26453..274b54b 100644 --- a/Assets/Weapons/PlayerWeapon.asset +++ b/Assets/Weapons/PlayerWeapon.asset @@ -106,12 +106,12 @@ MonoBehaviour: m_Bits: 128 accuracy: 2 zone: - numToSpawn: 2 + numToSpawn: 4 offset: {x: 0, y: 0, z: 0} spawnType: 1 spawnDir: 0 spawnPlane: 1 - width: 1.5 + width: 0.75 height: 0 surfaceOnly: 1 evenDistribution: 1 From 60f39951a5948216355c42c9fbcb593f59036a37 Mon Sep 17 00:00:00 2001 From: Dom Harris Date: Sun, 10 Jan 2021 17:34:30 +0000 Subject: [PATCH 5/6] fixed stupid wraparound issue --- Assets/Prefabs/Enemy.prefab | 15 ++++++++++++ Assets/Scenes/Chief's Sandbox.unity | 4 ++-- Assets/Scripts/AddScoreOnDie.cs | 2 ++ Assets/Scripts/WrapAroundOnEnable.cs | 28 +++++++++++++++++++++++ Assets/Scripts/WrapAroundOnEnable.cs.meta | 3 +++ Assets/Weapons/Enemy.asset | 4 ++-- 6 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 Assets/Scripts/WrapAroundOnEnable.cs create mode 100644 Assets/Scripts/WrapAroundOnEnable.cs.meta diff --git a/Assets/Prefabs/Enemy.prefab b/Assets/Prefabs/Enemy.prefab index c81ae66..4942de9 100644 --- a/Assets/Prefabs/Enemy.prefab +++ b/Assets/Prefabs/Enemy.prefab @@ -15,6 +15,7 @@ GameObject: - component: {fileID: 2766037370157449026} - component: {fileID: 2122656558574222561} - component: {fileID: -3971665732303992234} + - component: {fileID: -4901459127090716512} m_Layer: 7 m_Name: Enemy m_TagString: Untagged @@ -136,3 +137,17 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: value: 1000 +--- !u!114 &-4901459127090716512 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738226812227614583} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 990644fedd5c4b99befe1da660313b53, type: 3} + m_Name: + m_EditorClassIdentifier: + xMin: -10.1 + xMax: 10.1 diff --git a/Assets/Scenes/Chief's Sandbox.unity b/Assets/Scenes/Chief's Sandbox.unity index 4da9374..e0528d5 100644 --- a/Assets/Scenes/Chief's Sandbox.unity +++ b/Assets/Scenes/Chief's Sandbox.unity @@ -275,8 +275,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: spawnOnBeat: 1 - xMin: -5 - xMax: 5 + xMin: -10 + xMax: 10 --- !u!114 &531937975 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 5076175860835241000, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} diff --git a/Assets/Scripts/AddScoreOnDie.cs b/Assets/Scripts/AddScoreOnDie.cs index 63ffe84..8d41947 100644 --- a/Assets/Scripts/AddScoreOnDie.cs +++ b/Assets/Scripts/AddScoreOnDie.cs @@ -1,7 +1,9 @@ +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using Weapons.Scripts; +using Random = UnityEngine.Random; public class AddScoreOnDie : MonoBehaviour { diff --git a/Assets/Scripts/WrapAroundOnEnable.cs b/Assets/Scripts/WrapAroundOnEnable.cs new file mode 100644 index 0000000..e82e552 --- /dev/null +++ b/Assets/Scripts/WrapAroundOnEnable.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +public class WrapAroundOnEnable : MonoBehaviour +{ + [SerializeField] private float xMin, xMax; + + private void OnEnable() + { + WaitUtils.Wait(Time.deltaTime, true, () => + { + + var w = Mathf.Abs(xMax - xMin); + var x = transform.localPosition.x; + if (x > xMax) + { + x -= w; + } + else if (x < xMin) + { + x += w; + } + transform.localPosition = new Vector3( + x, + transform.localPosition.y, + transform.localPosition.z); + }); + } +} \ No newline at end of file diff --git a/Assets/Scripts/WrapAroundOnEnable.cs.meta b/Assets/Scripts/WrapAroundOnEnable.cs.meta new file mode 100644 index 0000000..064428d --- /dev/null +++ b/Assets/Scripts/WrapAroundOnEnable.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 990644fedd5c4b99befe1da660313b53 +timeCreated: 1610299723 \ No newline at end of file diff --git a/Assets/Weapons/Enemy.asset b/Assets/Weapons/Enemy.asset index f33f2a4..703880d 100644 --- a/Assets/Weapons/Enemy.asset +++ b/Assets/Weapons/Enemy.asset @@ -113,12 +113,12 @@ MonoBehaviour: spawnPlane: 1 width: 0 height: 0 - surfaceOnly: 1 + surfaceOnly: 0 evenDistribution: 0 numSides: 3 numPerSide: 10 flipVertical: 0 - radius: 5 + radius: 10 arc: 360 composite: [] manualFire: 1 From 74f27e1dbc0f1df003ede55da644036d4e3c25bc Mon Sep 17 00:00:00 2001 From: Dom Harris Date: Sun, 10 Jan 2021 17:41:15 +0000 Subject: [PATCH 6/6] obstacle spawner shit --- Assets/Materials/Enemy.mat | 2 +- Assets/Prefabs/Obstacle.prefab | 98 +++++++++++++++++++ Assets/Prefabs/Obstacle.prefab.meta | 7 ++ Assets/Scenes/Chief's Sandbox.unity | 143 ++++++++++++++++++++++++++++ Assets/Weapons/Obstacle.asset | 125 ++++++++++++++++++++++++ Assets/Weapons/Obstacle.asset.meta | 8 ++ 6 files changed, 382 insertions(+), 1 deletion(-) create mode 100644 Assets/Prefabs/Obstacle.prefab create mode 100644 Assets/Prefabs/Obstacle.prefab.meta create mode 100644 Assets/Weapons/Obstacle.asset create mode 100644 Assets/Weapons/Obstacle.asset.meta diff --git a/Assets/Materials/Enemy.mat b/Assets/Materials/Enemy.mat index b2ac44a..058ff04 100644 --- a/Assets/Materials/Enemy.mat +++ b/Assets/Materials/Enemy.mat @@ -13,7 +13,7 @@ Material: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 3000 + m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: diff --git a/Assets/Prefabs/Obstacle.prefab b/Assets/Prefabs/Obstacle.prefab new file mode 100644 index 0000000..a4d1d2c --- /dev/null +++ b/Assets/Prefabs/Obstacle.prefab @@ -0,0 +1,98 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1738226812227614583 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1738226812227614580} + - component: {fileID: 1738226812227614581} + - component: {fileID: 1738226812227614582} + - component: {fileID: -4901459127090716512} + m_Layer: 7 + m_Name: Obstacle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1738226812227614580 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738226812227614583} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 0.05, z: 0.6} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1738226812227614581 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738226812227614583} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1738226812227614582 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738226812227614583} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &-4901459127090716512 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738226812227614583} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 990644fedd5c4b99befe1da660313b53, type: 3} + m_Name: + m_EditorClassIdentifier: + xMin: -10.1 + xMax: 10.1 diff --git a/Assets/Prefabs/Obstacle.prefab.meta b/Assets/Prefabs/Obstacle.prefab.meta new file mode 100644 index 0000000..afbbbfb --- /dev/null +++ b/Assets/Prefabs/Obstacle.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a2fc4fe02da6b4c9dad4201dd60e32cc +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Chief's Sandbox.unity b/Assets/Scenes/Chief's Sandbox.unity index e0528d5..576454c 100644 --- a/Assets/Scenes/Chief's Sandbox.unity +++ b/Assets/Scenes/Chief's Sandbox.unity @@ -288,6 +288,75 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3147f962613cca54f8a0b78929a2854b, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &532372215 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 532372218} + - component: {fileID: 532372217} + - component: {fileID: 532372216} + m_Layer: 0 + m_Name: ObstacleSpawner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &532372216 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 532372215} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f8399031f014bee928b07d26fe8ee4c, type: 3} + m_Name: + m_EditorClassIdentifier: + spawnOnBeat: 1 + xMin: -10 + xMax: 10 +--- !u!114 &532372217 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 532372215} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1226902ebd2674aefa463e6dc0e75ad7, type: 3} + m_Name: + m_EditorClassIdentifier: + bulletPool: {fileID: 1061155885} + weapon: {fileID: 11400000, guid: 3b5089173dc14483fbd118af334cc1cb, type: 2} + bulletPos: {fileID: 532372218} + input: {fileID: 532372216} + OnFire: + m_PersistentCalls: + m_Calls: [] + OnBulletCollide: + m_PersistentCalls: + m_Calls: [] +--- !u!4 &532372218 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 532372215} + m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} + m_LocalPosition: {x: 0, y: -2, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} --- !u!1 &726912288 GameObject: m_ObjectHideFlags: 0 @@ -557,6 +626,52 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1061155884 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1061155886} + - component: {fileID: 1061155885} + m_Layer: 0 + m_Name: ObstaclePool + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1061155885 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1061155884} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9463c7c973b354f1c882567f52337aed, type: 3} + m_Name: + m_EditorClassIdentifier: + numObjects: 3000 + prefab: {fileID: 1738226812227614580, guid: a2fc4fe02da6b4c9dad4201dd60e32cc, type: 3} + numToSpawnPerFrame: 10 +--- !u!4 &1061155886 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1061155884} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -2, z: 30} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1077224733 PrefabInstance: m_ObjectHideFlags: 0 @@ -1425,10 +1540,38 @@ PrefabInstance: propertyPath: bpm value: 90 objectReference: {fileID: 0} + - target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3} + propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.size + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3} + propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_Mode + value: 0 + objectReference: {fileID: 0} - target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3} propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[0].m_Target value: objectReference: {fileID: 186457106} + - target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3} + propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_Target + value: + objectReference: {fileID: 532372216} + - target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3} + propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_CallState + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3} + propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName + value: OnBeat + objectReference: {fileID: 0} + - target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3} + propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_TargetAssemblyTypeName + value: BeatSpawner, Assembly-CSharp + objectReference: {fileID: 0} + - target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3} + propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_Arguments.m_ObjectArgumentAssemblyTypeName + value: UnityEngine.Object, UnityEngine + objectReference: {fileID: 0} - target: {fileID: 2145967175348613561, guid: 88246464365fd0745b75edfcff208598, type: 3} propertyPath: m_Name value: Audio diff --git a/Assets/Weapons/Obstacle.asset b/Assets/Weapons/Obstacle.asset new file mode 100644 index 0000000..53a751d --- /dev/null +++ b/Assets/Weapons/Obstacle.asset @@ -0,0 +1,125 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2bc932693ed0a470d9cf39b1c3168afb, type: 3} + m_Name: Obstacle + m_EditorClassIdentifier: + fireRate: 3 + bulletSpeed: + m_Mode: 0 + m_CurveMultiplier: 1 + m_CurveMin: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_CurveMax: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_ConstantMin: 20 + m_ConstantMax: 60 + bulletLifetime: + m_Mode: 0 + m_CurveMultiplier: 0 + m_CurveMin: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_CurveMax: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_ConstantMin: 15 + m_ConstantMax: 5 + bulletSize: + m_Mode: 0 + m_CurveMultiplier: 0 + m_CurveMin: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_CurveMax: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_ConstantMin: 0 + m_ConstantMax: 3 + damage: 1 + collidesWith: + serializedVersion: 2 + m_Bits: 64 + accuracy: 0 + zone: + numToSpawn: 1 + offset: {x: 0, y: 0, z: 0} + spawnType: 0 + spawnDir: 0 + spawnPlane: 1 + width: 0 + height: 0 + surfaceOnly: 1 + evenDistribution: 1 + numSides: 3 + numPerSide: 10 + flipVertical: 0 + radius: 0 + arc: 360 + composite: [] + manualFire: 1 + behaviour: {fileID: 11400000, guid: bb1cb2a77c68c42d4900953d18b23a49, type: 2} diff --git a/Assets/Weapons/Obstacle.asset.meta b/Assets/Weapons/Obstacle.asset.meta new file mode 100644 index 0000000..2f99863 --- /dev/null +++ b/Assets/Weapons/Obstacle.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3b5089173dc14483fbd118af334cc1cb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: