コード例 #1
0
    void HandleAI(CharacterBase AI)
    {
        while (AI.currentEnemy == null)
        {
            int selectPlayer = Random.Range(0, objectList.Count - 1);
            if (!objectList[selectPlayer].GetComponent <CharacterBase>().isDowned)
            {
                AI.currentEnemy = objectList[selectPlayer];
            }
        }

        int decisionValue = Random.Range(1, 7);

        if (decisionValue != 6)
        {
            AI.AIDecision(decisionValue);
        }
        else
        {
            for (int x = 0; x < objectList.Count - 1; x++)
            {
                if (!objectList[x].GetComponent <CharacterBase>().isDowned)
                {
                    AI.currentEnemy = objectList[x];
                    AI.AIDecision(4);
                }
            }
            Debug.Log("AI - MultiAttack");
            AI.currentEnemy = null;
        }

        objectList[objectList.Count - 1].CompleteTurn();

        StartCoroutine("Stop", 1);
        paused = true;
    }