コード例 #1
0
    // Update is called once per frame
    void LateUpdate()
    {
        if (gamestate == 1)
        {
            updateAllNodes();
            guimanager.updateBase(turnCount, recursoDinero, recursoGas, relicsaved, relicounter);
            guimanager.updateNode(selector.cursorNode);
            if (!selector.cursorNode.nodeOculto && selector.cursorNode.isThereAUnitHere())
            {
                guimanager.updateUnit(selector.cursorNode.unitInThisNode);
            }
            else
            {
                if (!selector.cursorNode.nodeOculto && selector.cursorNode.isThereAnEnemyHere())
                {
                    guimanager.updateEnemy(selector.cursorNode.enemyInThisNode);
                }
                else
                {
                    guimanager.hideUnitPanel();
                }
            }
        }

        if (Input.GetKey("escape"))
        {
            Application.Quit();
        }

        //DEBUG ONLY
        if (Input.GetKeyDown("2"))
        {
            foreach (Node n in grid)
            {
                n.revealNode();
            }
        }
        if (Input.GetKeyDown("3"))
        {
            gamestate = 3;
            StartCoroutine("endTurn");
        }
    }