예제 #1
0
    public void performAction(Tile tileSelected)
    {
        if (currentActionSelected < 0)
        {
            return;
        }
        Actions action = currentEntity.GetComponent<EntityActionManager>().actions[currentActionSelected];
        tileColorManager.resetValidSquares();
        if (tileSelected != null && currentActionSelected >= 0)
        {
            //playerSelectManager.mouseClicked();
            //undoManager.setGameState();
            //print(action.performAction(tileSelected.getLocation(), mapGenerator));
            if (action.performAction(tileSelected.getLocation(), mapGenerator))
            {
                action.performAnimations();
                gameManager.performAction();
                MapGenerator.updateTileScore();
                /*undoManager.saveGameState();
                undoManager.finishTurn();
                gameManager.performAction();
                MapGenerator.updateTileScore();*/
            }
        }
        else
        {
            undoManager.resetCurrentTurnInfo();
        }
        currentActionSelected = -1;


    }