using System.Collections; using System.Collections.Generic; using UnityEngine; public class Spark : MonoBehaviour { public string Name; public float LifeTime; private float time; public Transform Host; private void Awake() { } private void OnEnable() { time = 0; } private void Update() { time += Time.deltaTime; if(time > LifeTime) { SparksManager.Instance.CycleSpark(this); } if (Host != null) { transform.position = Host.position; } } }