private IEnumerator Stay() { MovingCollider moving_collider = Target.GetComponent <MovingCollider>(); if (moving_collider != null) { moving_collider.Stay(); yield return(new WaitForSeconds(stay_polling_time)); staying = false; } }
private IEnumerator TriggerMove() { MovingCollider moving_collider = Target.GetComponent <MovingCollider>(); if (moving_collider != null) { yield return(new WaitForSeconds(WaitTime)); yield return(moving_collider.TriggerAsync()); triggering = false; } }
public void Execute() { while (movingColliders.Count > 0) { MovingCollider movingCollider = movingColliders.Dequeue(); // remove from old cells: grid.RemoveFromCells(movingCollider.oldSpan, movingCollider.entity); // insert in new cells, as long as the index is below the amount of colliders. // otherwise, the collider is at the "tail" and there's no need to add it back. if (movingCollider.entity < colliderCount) grid.AddToCells(movingCollider.newSpan, movingCollider.entity); } // remove all empty cells from the grid: grid.RemoveEmpty(); }