private void OnDestroy() { using (PooledList <CoroutineInstance> instances = PooledList <CoroutineInstance> .Create()) { instances.AddRange(s_CurrentlyRunning); foreach (var instance in instances) { instance.Dispose(); } } }
/// <summary> /// Stops all executing sequences. /// </summary> public void StopAll() { using (PooledList <SequenceData> data = PooledList <SequenceData> .Create()) { data.AddRange(m_RunningSequences); for (int i = 0; i < data.Count; ++i) { data[i].Stop(); } } }
private void UpdateInstances() { using (PooledList <CoroutineInstance> instances = PooledList <CoroutineInstance> .Create()) { instances.AddRange(s_CurrentlyRunning); for (int i = 0; i < instances.Count; ++i) { var instance = instances[i]; if (!instance.m_Disposing) { instance.Update(); } if (instance.m_Disposing) { instance.Dispose(); } } } }