예제 #1
0
    private void Update()
    {
        RealTimeElapsed += Time.deltaTime;

        if (BattleData == null)
        {
            Debug.LogWarning("No battle data here, must be a test.", this);
            return;
        }

        CheckWinConditions();


        if (turnIsDone)
        {
            //Debug.Log("Changing turns");
            ChangeTurns();
            turnIsDone = false;
        }

        if (isPlayerTurn && playerUnitCount == unitsDone)
        {
            doneButton.BrightenButton();
            unitsDone++; //stupid, hacky, but efficient solution that prevents brightening the button in every frame even after it has already been brightened
        }
        else if (!isPlayerTurn && enemyUnitCount == unitsDone)
        {
            turnIsDone = true;
        }
    }