Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. void DestroyOrCollect(GamePiece p) {
  2.             LevelManager.instance.OnPieceCleared(p);
  3.             if (p.Type == Pieces.Type.CLEF) {
  4.                 grid.clefsManager.CollectClef(p);
  5.             } else if (p.Type == Pieces.Type.DIAMONDSBASKET &&
  6.                        p.GetComponent<DiamondsBasketPiece>().GetCurrentAmount() <= 0) {
  7.                 return;  
  8.             } else {
  9.                 p.ClearableComponent.Clear();
  10.             }
  11.             if (p.LayerID == GridData.mainLayerID && p.Type != Pieces.Type.DIAMONDSBASKET) {
  12.                 grid.Spawner.SpawnNewPiece(p.X, p.Y, Pieces.Type.EMPTY, GridData.mainLayerID);
  13.             }
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement