diff --git a/Assets/Prefabs/Particles/Explosionparticles.prefab b/Assets/Prefabs/Particles/Explosionparticles.prefab index e3f3f18..24d574e 100644 --- a/Assets/Prefabs/Particles/Explosionparticles.prefab +++ b/Assets/Prefabs/Particles/Explosionparticles.prefab @@ -48,7 +48,7 @@ ParticleSystem: ringBufferMode: 0 ringBufferLoopRange: {x: 0, y: 1} emitterVelocityMode: 1 - looping: 1 + looping: 0 prewarm: 0 playOnAwake: 1 useUnscaledTime: 0 @@ -4945,7 +4945,7 @@ ParticleSystem: ringBufferMode: 0 ringBufferLoopRange: {x: 0, y: 1} emitterVelocityMode: 1 - looping: 1 + looping: 0 prewarm: 0 playOnAwake: 1 useUnscaledTime: 0 diff --git a/Assets/Prefabs/Towers/BaseTower.prefab b/Assets/Prefabs/Towers/BaseTower.prefab index d3e66a6..e5a760d 100644 --- a/Assets/Prefabs/Towers/BaseTower.prefab +++ b/Assets/Prefabs/Towers/BaseTower.prefab @@ -14,6 +14,7 @@ GameObject: - component: {fileID: -4368249141776341009} - component: {fileID: 1772828647246745231} - component: {fileID: 3214375543219620994} + - component: {fileID: 5395307781823163591} m_Layer: 8 m_Name: BaseTower m_TagString: Untagged @@ -36,6 +37,7 @@ Transform: m_Children: - {fileID: 5000648575824335922} - {fileID: 8658008248069201232} + - {fileID: 8250573608784804583} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &7883233016828513649 @@ -54,6 +56,30 @@ MonoBehaviour: OnHealthZero: m_PersistentCalls: m_Calls: + - m_Target: {fileID: 5395307781823163591} + m_TargetAssemblyTypeName: Spawn, Assembly-CSharp + m_MethodName: SpawnNow + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - 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 Die + m_BoolArgument: 0 + m_CallState: 2 - m_Target: {fileID: 7883233016828513649} m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp m_MethodName: SimpleKill @@ -164,6 +190,20 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d720360aef3510faf93af9ce3a78b2fc, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &5395307781823163591 +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: 8284bc9546293b11491f9b612f1201e2, type: 3} + m_Name: + m_EditorClassIdentifier: + prefab: {fileID: 8118098614606808160, guid: ccb00436ef21d07468d582c764f12304, type: 3} + desrtoyAfter: 10 --- !u!1 &4657144566828515878 GameObject: m_ObjectHideFlags: 0 @@ -639,3 +679,82 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 4242914981235942237} m_PrefabAsset: {fileID: 0} +--- !u!1001 &4633451711229928249 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 527409087646353271} + m_Modifications: + - target: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8118098614606808160, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_Name + value: Explosionparticles + objectReference: {fileID: 0} + - target: {fileID: 8118098614606808160, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ccb00436ef21d07468d582c764f12304, type: 3} +--- !u!4 &8250573608784804583 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3617163679098575326, guid: ccb00436ef21d07468d582c764f12304, + type: 3} + m_PrefabInstance: {fileID: 4633451711229928249} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Scripts/Utilities/EnableCompare.cs b/Assets/Scripts/Utilities/EnableCompare.cs index 0e2a3a1..1e426dd 100644 --- a/Assets/Scripts/Utilities/EnableCompare.cs +++ b/Assets/Scripts/Utilities/EnableCompare.cs @@ -20,4 +20,9 @@ public class EnableCompare : MonoBehaviour toEnable.SetActive(true); } } + + public void ForceEnable() + { + toEnable.SetActive(true); + } } diff --git a/Assets/Scripts/Utilities/Spawn.cs b/Assets/Scripts/Utilities/Spawn.cs new file mode 100644 index 0000000..86e21bb --- /dev/null +++ b/Assets/Scripts/Utilities/Spawn.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Spawn : MonoBehaviour +{ + [SerializeField] GameObject prefab; + public float desrtoyAfter = 10f; + + public void SpawnNow() + { + var go = Instantiate(prefab); + go.transform.position = transform.position; + Destroy(go, desrtoyAfter); + } +} diff --git a/Assets/Scripts/Utilities/Spawn.cs.meta b/Assets/Scripts/Utilities/Spawn.cs.meta new file mode 100644 index 0000000..d03a5ea --- /dev/null +++ b/Assets/Scripts/Utilities/Spawn.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8284bc9546293b11491f9b612f1201e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: