diff --git a/Assets/Audio/AudioLib.asset b/Assets/Audio/AudioLib.asset new file mode 100644 index 0000000..1821385 --- /dev/null +++ b/Assets/Audio/AudioLib.asset @@ -0,0 +1,24 @@ +%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: 3bbffcd63584e8040b9a8db3b8d51737, type: 3} + m_Name: AudioLib + m_EditorClassIdentifier: + Clips: + - {fileID: 8300000, guid: ea208a46b2ab9bc45b936d5d7e0455cf, type: 3} + - {fileID: 8300000, guid: 58d0fae7e12873e4293f7e9bce59fcdc, type: 3} + - {fileID: 8300000, guid: 1d08abd4771cf954a92649be9eaa32da, type: 3} + - {fileID: 8300000, guid: fe1f2d7ea272e2d47aa2140b739f93fa, type: 3} + - {fileID: 8300000, guid: 5334bf6f5b0d55e48b4ee74b3210a3f4, type: 3} + - {fileID: 8300000, guid: 32b4f8d9c44560c4d942029ff998e387, type: 3} + - {fileID: 8300000, guid: fbb9883b31821d5478ace5f439fe9f81, type: 3} + - {fileID: 8300000, guid: e850f3f8ab5051943a09bc30110ad96a, type: 3} + - {fileID: 8300000, guid: b60baeeadcb135747ac37bf4c4684ac4, type: 3} diff --git a/Assets/Audio/AudioLib.asset.meta b/Assets/Audio/AudioLib.asset.meta new file mode 100644 index 0000000..109f67a --- /dev/null +++ b/Assets/Audio/AudioLib.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 33d9499f0cd319b2eab27cf0f8e39a40 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Managers.prefab b/Assets/Prefabs/Managers.prefab index 5ddeed3..7e6bb56 100644 --- a/Assets/Prefabs/Managers.prefab +++ b/Assets/Prefabs/Managers.prefab @@ -10,6 +10,7 @@ GameObject: m_Component: - component: {fileID: 2430881567806754708} - component: {fileID: 420908950823711560} + - component: {fileID: 6434302952035194364} m_Layer: 0 m_Name: Managers m_TagString: Untagged @@ -46,7 +47,16 @@ MonoBehaviour: m_EditorClassIdentifier: Balance: 0 IsBuildMode: 0 - ShopSelectedTower: - name: - price: 0 - prefab: {fileID: 0} +--- !u!114 &6434302952035194364 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 167310329963132665} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 36c44df45a33eca4285d258763a7b018, type: 3} + m_Name: + m_EditorClassIdentifier: + audioLibrary: {fileID: 11400000, guid: 33d9499f0cd319b2eab27cf0f8e39a40, type: 2} diff --git a/Assets/Prefabs/Towers/BaseTower.prefab b/Assets/Prefabs/Towers/BaseTower.prefab index f723f9d..b731fe1 100644 --- a/Assets/Prefabs/Towers/BaseTower.prefab +++ b/Assets/Prefabs/Towers/BaseTower.prefab @@ -14,6 +14,7 @@ GameObject: - component: {fileID: -4368249141776341009} - component: {fileID: 8326258332086092779} - component: {fileID: 1772828647246745231} + - component: {fileID: 3214375543219620994} m_Layer: 8 m_Name: BaseTower m_TagString: Untagged @@ -87,6 +88,21 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 + OnHealthChange3: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 3214375543219620994} + m_TargetAssemblyTypeName: PlaySound, Assembly-CSharp + m_MethodName: PlayASound + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Tower Damage + m_BoolArgument: 0 + m_CallState: 2 --- !u!65 &5565472806559733162 BoxCollider: m_ObjectHideFlags: 0 @@ -245,6 +261,18 @@ MonoBehaviour: m_EditorClassIdentifier: toEnable: {fileID: 3424060888733970503} threshold: 30 +--- !u!114 &3214375543219620994 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 872127579833310669} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d720360aef3510faf93af9ce3a78b2fc, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &881819783351085137 GameObject: m_ObjectHideFlags: 0 @@ -651,8 +679,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3558272651156871278} serializedVersion: 2 - m_LocalRotation: {x: 0.34042525, y: 0.0000000228801, z: -0.000000008283737, w: 0.9402716} - m_LocalPosition: {x: 0, y: 1.661, z: -3} + m_LocalRotation: {x: 0.34042525, y: -0.00000002288009, z: 0.000000008283735, w: 0.9402716} + m_LocalPosition: {x: -1.745, y: 2.334, z: -3} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -730,8 +758,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4474798581911876227} serializedVersion: 2 - m_LocalRotation: {x: 0.32326588, y: 0.000000016282542, z: -0.0000000055622356, w: 0.9463082} - m_LocalPosition: {x: 0, y: 1.661, z: -3} + m_LocalRotation: {x: 0.32326588, y: -0.000000016282542, z: 0.0000000055622356, w: 0.9463082} + m_LocalPosition: {x: -1.745, y: 2.334, z: -3} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -1145,8 +1173,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6616012430861705016} serializedVersion: 2 - m_LocalRotation: {x: 0.3060453, y: -0.000000023165901, z: 0.0000000074471513, w: 0.952017} - m_LocalPosition: {x: 0, y: -32.5, z: 39} + m_LocalRotation: {x: 0.3060453, y: 0.000000023165901, z: -0.0000000074471513, w: 0.952017} + m_LocalPosition: {x: -1.745, y: 2.334, z: -3} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: diff --git a/Assets/Scripts/Utilities/HealthComponent.cs b/Assets/Scripts/Utilities/HealthComponent.cs index c4ae7eb..2b134bb 100644 --- a/Assets/Scripts/Utilities/HealthComponent.cs +++ b/Assets/Scripts/Utilities/HealthComponent.cs @@ -14,6 +14,7 @@ public class HealthComponent : MonoBehaviour public UnityEvent OnHealthZero; public UnityEvent OnHealthChange; public UnityEvent OnHealthChange2; + public UnityEvent OnHealthChange3; void Awake() { @@ -24,6 +25,7 @@ public class HealthComponent : MonoBehaviour { OnHealthChange?.Invoke(currentHealth, currentHealth - damage); OnHealthChange2?.Invoke(currentHealth - damage); + OnHealthChange3.Invoke(); OnHealthChangeAtPos?.Invoke(transform.position, currentHealth - damage); currentHealth -= damage; diff --git a/Assets/Scripts/Utilities/PlaySound.cs b/Assets/Scripts/Utilities/PlaySound.cs new file mode 100644 index 0000000..3b322d1 --- /dev/null +++ b/Assets/Scripts/Utilities/PlaySound.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlaySound : MonoBehaviour +{ + public void PlayASound(string filename) + { + AudioManager.PlaySound(filename, transform.position); + } +} diff --git a/Assets/Scripts/Utilities/PlaySound.cs.meta b/Assets/Scripts/Utilities/PlaySound.cs.meta new file mode 100644 index 0000000..4b13f4d --- /dev/null +++ b/Assets/Scripts/Utilities/PlaySound.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d720360aef3510faf93af9ce3a78b2fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: