Пример #1
0
    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);
    }
Пример #2
0
    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;
        }
    }
Пример #3
0
 public void Add(PowerupExe powerup)
 {
     powerups.Add(PowerupFactory.GetPowerup(powerup));
 }
Пример #4
0
 public void RecordMove(PowerupExe powerup)
 {
     this.powExe = powerup;
 }