Example #1
0
    public VFXInstance Pop(string name, float duration)
    {
        VFXInstance result = Pop(name);

        StartCoroutine(WaitThenPushRoutine(result, duration));

        return(result);
    }
Example #2
0
        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);
            }
        }
Example #3
0
 public void Push(VFXInstance instance)
 {
     database[instance.Name].Push(instance);
 }
Example #4
0
    private IEnumerator WaitThenPushRoutine(VFXInstance instance, float duration)
    {
        yield return(new WaitForSeconds(duration));

        Push(instance);
    }