コード例 #1
0
    IEnumerator EnemyThinkingRoutine(float puseDuration)
    {
        Debug.Log("Enemy thinking...");
        yield return(new WaitForSeconds(puseDuration));

        // look to see if there are any slimes in play
        _slimeToAttack = GameObject.Find("Slime");

        // if a slime is not found target player
        if (_slimeToAttack = null)
        {
            targetToAttack = player;
        }
        // if a slime is found target that slime
        else
        {
            targetToAttack = _slimeToAttack;
        }

        // creature chooses its attack and preforms it
        creatue.ChooseAttack();
        Debug.Log("Enemy performs action");

        // at end of turn, end dragonRage if it was activated
        creatue.isRaging = false;

        EnemyTurnEnded?.Invoke();
        // turn over. Go back to Player
        StateMachine.ChangeState <PlayerTurnCardGameState>();
    }