init
This commit is contained in:
commit
341a877b4a
2338 changed files with 1346408 additions and 0 deletions
34
Assets/Scripts/Particles/FireChildSystems.cs
Normal file
34
Assets/Scripts/Particles/FireChildSystems.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class FireChildSystems : MonoBehaviour
|
||||
{
|
||||
public bool destroyOnEnd = true;
|
||||
public string soundKey = "";
|
||||
|
||||
[ContextMenu("Fire Shurikens")]
|
||||
void fireChildParticles()
|
||||
{
|
||||
foreach(ParticleSystem ps in GetComponentsInChildren<ParticleSystem>())
|
||||
{
|
||||
ps.Play();
|
||||
}
|
||||
if (soundKey.Length != 0)
|
||||
AudioManager.instance.PlayOneShot(soundKey);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
fireChildParticles();
|
||||
Invoke(nameof(Autodestroy), 4);
|
||||
}
|
||||
|
||||
void Autodestroy()
|
||||
{
|
||||
if (destroyOnEnd)
|
||||
Destroy(gameObject);
|
||||
else
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue