public VFXInstance Pop(string name, float duration) { VFXInstance result = Pop(name); StartCoroutine(WaitThenPushRoutine(result, duration)); return(result); }
void CreateNewInstances(int index) { var entry = Database.Entries[index]; for (int j = 0; j < entry.PoolSize; ++j) { VFXInstance vfxInstance = new VFXInstance(); var inst = Instantiate(entry.Prefab); inst.gameObject.SetActive(false); vfxInstance.Effect = inst; vfxInstance.Index = index; m_Instances[index].Enqueue(vfxInstance); } }
public void Push(VFXInstance instance) { database[instance.Name].Push(instance); }
private IEnumerator WaitThenPushRoutine(VFXInstance instance, float duration) { yield return(new WaitForSeconds(duration)); Push(instance); }