diff options
author | chai <215380520@qq.com> | 2023-11-27 00:08:06 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-11-27 00:08:06 +0800 |
commit | d4af52c91a717d0ee324f81ad5a673d4a6ba9207 (patch) | |
tree | bdb610929b8cd3064632f12479cd47c16b752045 /Assembly_CSharp/Other | |
parent | b45e22c164fa364263b00ce82842999f8e5976b2 (diff) |
*move
Diffstat (limited to 'Assembly_CSharp/Other')
-rw-r--r-- | Assembly_CSharp/Other/Explosion.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Assembly_CSharp/Other/Explosion.cs b/Assembly_CSharp/Other/Explosion.cs new file mode 100644 index 0000000..a01aa17 --- /dev/null +++ b/Assembly_CSharp/Other/Explosion.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +public class Explosion : MonoBehaviour +{ + [SerializeField] + private float duration = 2f; + + [SerializeField] + private Sound sound; + + private void Start() + { + if (sound != 0) + { + SFXManager.instance.PlaySound(sound, base.transform.position); + } + } + + private void FixedUpdate() + { + duration -= Time.fixedDeltaTime; + if (duration <= 0f) + { + Object.Destroy(base.gameObject); + } + } +} |