public void placeObject(Block block, Vector2 pos, float deg, bool wasDummy = true) { if (canPlacePiece(pos, block, deg)) { level.setBlock((int)pos.x, (int)pos.y, block, deg); if (!wasDummy) { pos = transformToGrid(pos, block.getWidthHeight(deg)); grid.placeObject(pos.x, pos.y, block.getBlueprintPrefab(), deg); } else { AudioPlayer("Building"); saveToDevice(); } drawRoad(); } else { level.removeBlock(block); block.removeBlueprintPrefab(); AudioPlayer("error"); } level.storeCompleteStatus(); }
public void OnPointerClick(PointerEventData eventData) { AudioProvider.getInstance().playAudio("Reset"); placer.clearBlocks(); Level level = GameMode.getCurrentLevel(); level.setLocked(false); level.storeCompleteStatus(); }