You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
735 B
35 lines
735 B
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.Events; |
|
using UnityEngine.Serialization; |
|
|
|
public class ParticleHide : MonoBehaviour |
|
{ |
|
public ParticleSystem particle; |
|
|
|
[System.Serializable] |
|
public class EndEvent : UnityEvent { } |
|
[FormerlySerializedAs("onEnded")] |
|
[SerializeField] |
|
[Space(10)] |
|
private EndEvent onEnded = new EndEvent(); |
|
|
|
public bool HIDE = true; |
|
void Update() |
|
{ |
|
if(!particle.isPlaying) |
|
{ |
|
particle.Stop(); |
|
particle.time = 0; |
|
gameObject.SetActive(!HIDE); |
|
|
|
onEnded.Invoke(); |
|
} |
|
} |
|
|
|
public void OnClick() |
|
{ |
|
gameObject.SetActive(true); |
|
} |
|
}
|
|
|