private void DestroyCube(GameObject cube) { if (cube.name == "NaughtyCube(Clone)") { floorBlocks.DestroyRow(); RowDestroyed(); } else if (cube.name == "MagicCube(Clone)") { PlaceMagicSquare(cube.transform.position); } if (!demoStage) { stage.PlayerDestroyedCube(cube); } cube.GetComponent <Cube>().DestroyCube(); }
public void CubeFallen(GameObject cube) { if (!cube.GetComponent <Cube>().BeingDestroyed) { bool isNaughty = cube.name == "NaughtyCube(Clone)"; if (!isNaughty) { perfectPuzzle = false; } else if (isNaughty && !playerController.PlayerCrushed) { score += 10; } if (ShouldDestoryRow(isNaughty)) { floorBlocks.DestroyRow(); playerController.RowDestroyed(); } cubesLeft--; } }