diff --git a/Assets/Prefabs/Towers/BlackHole.prefab b/Assets/Prefabs/Towers/BlackHole.prefab index 187e565..d07b9ef 100644 --- a/Assets/Prefabs/Towers/BlackHole.prefab +++ b/Assets/Prefabs/Towers/BlackHole.prefab @@ -176,6 +176,41 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 85471039882070109, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 85471039882070109, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.5 + objectReference: {fileID: 0} + - target: {fileID: 85471039882070109, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalPosition.z + value: -10 + objectReference: {fileID: 0} + - target: {fileID: 85471039882070109, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.99934006 + objectReference: {fileID: 0} + - target: {fileID: 85471039882070109, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.03632495 + objectReference: {fileID: 0} + - target: {fileID: 85471039882070109, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.y + value: 3.153011e-36 + objectReference: {fileID: 0} + - target: {fileID: 85471039882070109, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.z + value: 1.3634104e-37 + objectReference: {fileID: 0} - target: {fileID: 527409087646353271, guid: f54a14318952c90c5b47a300aedb0d15, type: 3} propertyPath: m_LocalPosition.x @@ -231,6 +266,76 @@ PrefabInstance: propertyPath: m_Name value: BlackHole objectReference: {fileID: 0} + - target: {fileID: 3231648858884615218, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3231648858884615218, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.5 + objectReference: {fileID: 0} + - target: {fileID: 3231648858884615218, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalPosition.z + value: -10 + objectReference: {fileID: 0} + - target: {fileID: 3231648858884615218, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3231648858884615218, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.x + value: 2.524355e-29 + objectReference: {fileID: 0} + - target: {fileID: 3231648858884615218, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3231648858884615218, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4220667717328304921, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4220667717328304921, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.5 + objectReference: {fileID: 0} + - target: {fileID: 4220667717328304921, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalPosition.z + value: -10 + objectReference: {fileID: 0} + - target: {fileID: 4220667717328304921, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.9998346 + objectReference: {fileID: 0} + - target: {fileID: 4220667717328304921, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.018189488 + objectReference: {fileID: 0} + - target: {fileID: 4220667717328304921, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.00000001990998 + objectReference: {fileID: 0} + - target: {fileID: 4220667717328304921, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + propertyPath: m_LocalRotation.z + value: -3.6221226e-10 + objectReference: {fileID: 0} - target: {fileID: 5565472806559733162, guid: f54a14318952c90c5b47a300aedb0d15, type: 3} propertyPath: m_Size.x @@ -738,7 +843,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4fb850aad740b9b418ade5f74fff1818, type: 3} m_Name: m_EditorClassIdentifier: - selectedUI: {fileID: 0} + selectedUI: {fileID: 8306284257086165764} + OnAttack: + m_PersistentCalls: + m_Calls: [] radius: 1.5 orb: {fileID: 6791947043022790992} affectedBodies: @@ -768,6 +876,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + audioName: Black Hole --- !u!4 &6783638013035996559 stripped Transform: m_CorrespondingSourceObject: {fileID: 7908333169234343085, guid: f54a14318952c90c5b47a300aedb0d15, @@ -826,6 +935,12 @@ MonoBehaviour: m_Calls: [] m_LegacyBlendHint: 0 m_ComponentOwner: {fileID: 1864488023534541641} +--- !u!1 &8306284257086165764 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4657144566828515878, guid: f54a14318952c90c5b47a300aedb0d15, + type: 3} + m_PrefabInstance: {fileID: 3739212318609641762} + m_PrefabAsset: {fileID: 0} --- !u!4 &8515585331188365258 stripped Transform: m_CorrespondingSourceObject: {fileID: 5028610344310564584, guid: f54a14318952c90c5b47a300aedb0d15, diff --git a/Assets/Scenes/TowerTest.unity b/Assets/Scenes/TowerTest.unity index 7572f5c..1a2964c 100644 --- a/Assets/Scenes/TowerTest.unity +++ b/Assets/Scenes/TowerTest.unity @@ -123,6 +123,144 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1001 &100479262 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 681885395900820027, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.x + value: -3.5232341 + objectReference: {fileID: 0} + - target: {fileID: 681885395900820027, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.y + value: -1.025 + objectReference: {fileID: 0} + - target: {fileID: 681885395900820027, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.z + value: -10.335055 + objectReference: {fileID: 0} + - target: {fileID: 681885395900820027, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.000000017203512 + objectReference: {fileID: 0} + - target: {fileID: 681885395900820027, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalRotation.z + value: 3.129748e-10 + objectReference: {fileID: 0} + - target: {fileID: 2251032668217228560, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.x + value: -3.5232341 + objectReference: {fileID: 0} + - target: {fileID: 2251032668217228560, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.y + value: -1.025 + objectReference: {fileID: 0} + - target: {fileID: 2251032668217228560, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.z + value: -10.335055 + objectReference: {fileID: 0} + - target: {fileID: 2251032668217228560, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalRotation.x + value: -1e-45 + objectReference: {fileID: 0} + - target: {fileID: 3660299222164380031, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.x + value: -3.5232341 + objectReference: {fileID: 0} + - target: {fileID: 3660299222164380031, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.y + value: -1.025 + objectReference: {fileID: 0} + - target: {fileID: 3660299222164380031, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.z + value: -10.335055 + objectReference: {fileID: 0} + - target: {fileID: 3660299222164380031, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3660299222164380031, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.x + value: 3.5232341 + objectReference: {fileID: 0} + - target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.y + value: 1.025 + objectReference: {fileID: 0} + - target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalPosition.z + value: 0.33505535 + objectReference: {fileID: 0} + - target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4611178744751000815, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, + type: 3} + propertyPath: m_Name + value: BlackHole + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, type: 3} --- !u!1 &410087039 GameObject: m_ObjectHideFlags: 0 @@ -1101,7 +1239,7 @@ PrefabInstance: - target: {fileID: 645933633211530419, guid: 4e5e3131ea2a78cfd93219be3806da6d, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2897404306948410700, guid: 4e5e3131ea2a78cfd93219be3806da6d, type: 3} @@ -1166,12 +1304,12 @@ PrefabInstance: - target: {fileID: 4503151795702995559, guid: 4e5e3131ea2a78cfd93219be3806da6d, type: 3} propertyPath: m_LocalRotation.y - value: -0.000000016282542 + value: 0.000000016282542 objectReference: {fileID: 0} - target: {fileID: 4503151795702995559, guid: 4e5e3131ea2a78cfd93219be3806da6d, type: 3} propertyPath: m_LocalRotation.z - value: 0.0000000055622356 + value: -0.0000000055622356 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] @@ -1976,3 +2114,4 @@ SceneRoots: - {fileID: 762567055} - {fileID: 1090335998} - {fileID: 1231481559} + - {fileID: 100479262} diff --git a/Assets/Scripts/Tower/GravityTower.cs b/Assets/Scripts/Tower/GravityTower.cs index 0f4573c..a024b49 100644 --- a/Assets/Scripts/Tower/GravityTower.cs +++ b/Assets/Scripts/Tower/GravityTower.cs @@ -14,6 +14,9 @@ public class GravityTower : Tower [SerializeField] private AnimationCurve distToAcceleration; + [SerializeField] + private string audioName; + public override void TowerSelected(bool selected) { @@ -24,6 +27,17 @@ public class GravityTower : Tower base.Awake(); } + protected override void Start() + { + base.Start(); + + if (!string.IsNullOrEmpty(audioName)) + { + Debug.Log("play"); + AudioManager.PlaySound(audioName, transform.position); + } + } + protected override void FixedUpdate() { Collider[] projectilesInRadius = Physics.OverlapSphere(orb.position, radius, affectedBodies);