Ejemplo n.º 1
0
    void OperateOnBox(NumberBox box)
    {
        switch (myPower)
        {
        case Power.MOVE:
            if (box.MoveBox(movement, wallObstacles))
            {
                StartCoroutine(Move(moveToPosition));
            }
            break;

        case Power.ADD3:
            box.SetNumberValue(box.GetNumberValue() + 3);
            currentRoom.UpdateEquation();
            break;

        case Power.ADD5:
            box.SetNumberValue(box.GetNumberValue() + 5);
            currentRoom.UpdateEquation();
            break;

        case Power.ADD7:
            box.SetNumberValue(box.GetNumberValue() + 7);
            currentRoom.UpdateEquation();
            break;

        case Power.RESET:
            box.ResetOperations();
            currentRoom.UpdateEquation();
            break;

        default:
            break;
        }
    }