public static PowerupExe GetPowerup(PowerupExe powerup) { var type = powerup.GetType().ToString(); /*switch (type) { * * case "RotateExe": * return new RotateExe (powerup.startPos, powerup.direction); * case "SwitchExe": * return new SwitchExe (powerup.startPos, powerup.direction); * case "SwitchRowExe": * return new SwitchRowExe (powerup.startPos, powerup.direction); * default: * Debug.LogError ("PowerupFactory: Powerup type " + type + " not defined!"); * return null; * }*/ return(null); }
public void UndoMove() { if (powExe != null) { if (doUndoTutorial) { StartCoroutine(UpdateUndoButtonTutorial()); } LevelManager.instance.moveInfo [powExe.type]++; LevelManager.instance.movesLeft++; changeMoveInfo = false; var cube = new List <Cube> () { powExe.cube }; var type = powExe.type; switch (type) { case 0: StartCoroutine(powerups.ExecutePowerup(type, cube, powExe.positions, powExe.direction)); break; case 1: if (cube [0] == null) { StartCoroutine(powerups.ExecutePowerup(type, powExe.cubes, powExe.positions, powExe.direction)); } break; case 2: StartCoroutine(powerups.ExecutePowerup(type, cube, powExe.positions, powExe.direction)); break; } changeMoveInfo = true; UpdateMoves(); powExe = null; } }
public void Add(PowerupExe powerup) { powerups.Add(PowerupFactory.GetPowerup(powerup)); }
public void RecordMove(PowerupExe powerup) { this.powExe = powerup; }