1234567891011121314151617181920212223242526 |
- using UnityEngine;
- using System.Collections;
- public class BuffEffect : MonoBehaviour {
- public float delayRemove = 1f;
- private float removeTime = -1f;
- public void Remove()
- {
- ParticleSystem[] psArr = GetComponentsInChildren<ParticleSystem>();
- for(int i=0; i<psArr.Length; i++)
- {
- psArr[i].enableEmission = false;
- }
- }
- // Update is called once per frame
- void Update ()
- {
- if(removeTime >= 0 && GameTime.time - removeTime > delayRemove)
- {
- Destroy(this.gameObject);
- }
- }
- }
|