/// <summary> /// Returns a cube to the resource pool so others can make use of it later. /// Thanks for your patronage! /// </summary> /// <param name="ct">Instantiated cube you're returning to the pool.</param> public void ReturnCube(MineableBlock ct) { blocks.Push(ct); ct.transform.position = DEFAULT_POSITION; }
/// <summary> /// Deallocates the provided instance block, returning it to the allocator for future /// use elsewhere in the maze. /// /// Also, this function calls DestroyCube on the spawned block's Cube property. No /// parent class should be calling Destroy cube if they have a MineableBlock for that /// cube instead. /// </summary> /// <param name="ct">Instantiated block to be deallocated.</param> public void DestroyMineableBlock(MineableBlock ct) { DestroyCube(ct._cube); allocator.ReturnCube(ct); blocks.Remove(ct); }