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);
|
||||
}
|
||||
}
|
11
Assets/Scripts/Particles/FireChildSystems.cs.meta
Normal file
11
Assets/Scripts/Particles/FireChildSystems.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4a3a455da2415fd45aa36124dafa3d09
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
33
Assets/Scripts/Particles/ParticleSystemAutoDestroy.cs
Normal file
33
Assets/Scripts/Particles/ParticleSystemAutoDestroy.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public enum DisablingAction
|
||||
{
|
||||
Destroy, Deactivate
|
||||
}
|
||||
|
||||
public class ParticleSystemAutoDestroy : MonoBehaviour
|
||||
{
|
||||
public DisablingAction action = DisablingAction.Deactivate;
|
||||
private ParticleSystem ps;
|
||||
|
||||
|
||||
public void Start()
|
||||
{
|
||||
ps = GetComponent<ParticleSystem>();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (ps)
|
||||
{
|
||||
if (!ps.IsAlive())
|
||||
{
|
||||
if (action == DisablingAction.Deactivate)
|
||||
gameObject.SetActive(false);
|
||||
else
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Particles/ParticleSystemAutoDestroy.cs.meta
Normal file
11
Assets/Scripts/Particles/ParticleSystemAutoDestroy.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eb47a169d3ce5a6489ef2f5b15d4434b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue