/// <summary> Called once per frame </summary> void Update() { color.a -= Time.deltaTime / fadeTime; if (color.a <= 0.0f) { RecyclePool.Recycle(RecyclePool.PoolTypes.BlockDisappear, gameObject); } else { material.color = color; } }
/// <summary> Recycles all spawned items </summary> public void ClearAllEffects() { for (int i = 0; i < fallingRings.Count; ++i) { RecyclePool.Recycle(RecyclePool.PoolTypes.FallingRing, fallingRings[i].gameObject); } fallingRings.Clear(); for (int i = 0; i < shockwaves.Count; ++i) { RecyclePool.Recycle(RecyclePool.PoolTypes.Shockwave, shockwaves[i].gameObject); } shockwaves.Clear(); }
/// <summary> Called from a shockwave when it finishes growing + fading </summary> /// <param name="_shockwave"> Shockwave that just finished </param> public void ShockwaveFinished(Shockwave _shockwave) { RecyclePool.Recycle(RecyclePool.PoolTypes.Shockwave, _shockwave.gameObject); shockwaves.Remove(_shockwave); }
/// <summary> Called from the ring when it hits the ground </summary> /// <param name="_ring"> Ring that just finished falling </param> public void RingFinishedFalling(FallingRing _ring) { RecyclePool.Recycle(RecyclePool.PoolTypes.FallingRing, _ring.gameObject); fallingRings.Remove(_ring); }