private void RemoveDelayedDestruction(int index) { var delayedDestruction = delayedDestructions [index]; delayedDestructions.RemoveAt(index); LeanClassPool <DelayedDestruction> .Despawn(delayedDestruction); }
public void CanSpawnObjectByType() { LeanClassPool.Clear(); var o = new TestLeanClassPool(); LeanClassPool.Despawn(o); Assert.AreSame(LeanClassPool.Spawn <TestLeanClassPool>(), o); }
public void CanSpawnLastObject() { LeanClassPool <Object> .Clear(); var o = new Object(); LeanClassPool <Object> .Despawn(o); Assert.AreSame(LeanClassPool <Object> .Spawn(), o); }
void Cleanup() { finalFunc.OnDespawn(); LeanClassPool <UAsyncFinalFunc> .Despawn(finalFunc); taskRoutines.Clear(); func.OnDespawn(); LeanClassPool <ChildFunc <T> > .Despawn(func); }
void Cleanup() { finalFunc.action1 = null; LeanClassPool <UAsyncFinalFunc> .Despawn(finalFunc); taskRoutine = null; for (int i = 0; i < funcs.Count; i++) { funcs [i].OnDespawn(); LeanClassPool <ChildFunc> .Despawn(funcs [i]); } funcs.Clear(); }
static IEnumerator Update() { while (true) { yield return(_waitUpdate); AsyncTask asyncTask; for (int i = _asyncTasks.Count - 1; i > 0; i--) { asyncTask = _asyncTasks [i]; if (asyncTask != null && asyncTask.IsFree) { _asyncTasks.RemoveAt(i); _asyncTaskIds.RemoveAt(i); LeanClassPool.Despawn(asyncTask); } } } }