예제 #1
0
    // Drives the current behavior based on what phase of the game is taking place.
    void ManageTurn()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }

        switch (gP)
        {
        case (GamePhase.Deploy):
            DeployMaster.SetTiles();     // let users set units
            break;

        case (GamePhase.Cannon):
            CannonMaster.HandleCannons();     // let users turn and fire cannons
            break;

        case (GamePhase.Move):
            MoveMaster.DecideMove();     // let users move available units
            break;

        case (GamePhase.Attack):     // Attack phase currently resolves itself with no need for user input
            break;

        default:
            break;
        }
    }
예제 #2
0
    void Update()
    {
        Debug.Log(PlayerMaster.PriorTurn);

        if (acceptInput)
        {
            switch (phase)
            {
            case T_Phases.Deploy:
                DeployMaster.SetTutorialTiles();
                if (d_markers.transform.childCount == 0)
                {
                    turn_button.interactable = true;
                }
                if (PlayerMaster.CurrentTurn == 1)
                {
                    acceptInput = false;
                    ai_turn     = true;
                    instance.StartCoroutine(TutorialAI.Deploy());
                }
                break;

            case T_Phases.Move:
                MoveMaster.DecideMove();
                if (PlayerMaster.CurrentTurn == 1)
                {
                    acceptInput = false;
                    ai_turn     = true;
                    instance.StartCoroutine(TutorialAI.Move());
                }
                break;

            case T_Phases.Cannon:
                CannonMaster.HandleCannons();
                if (PlayerMaster.CurrentTurn == 1)
                {
                    acceptInput = false;
                    ai_turn     = true;
                    instance.StartCoroutine(TutorialAI.IDontHaveCannons());
                }
                break;

            case T_Phases.Fight:
                MoveMaster.DecideMove();
                if (PlayerMaster.CurrentTurn == 1)
                {
                    acceptInput = false;
                    ai_turn     = true;
                    instance.StartCoroutine(TutorialAI.Move());
                }
                break;

            default:
                Debug.Log("Default");
                break;
            }
        }

        if (ai_turn)
        {
            if (PlayerMaster.CurrentTurn == 0)
            {
                ai_turn = false;
                TutorialUIMaster.c_bool = false;
                TutorialUIMaster.SetContinue(false);
                NextPhase();
                instance.StartCoroutine(TutorialUIMaster.MoveTextbox());
            }
        }
    }