示例#1
0
    void Turn()
    {
        var characters = FindObjectsOfType <Character>();

        //MOVEMENT PHASE
        foreach (var character in characters)
        {
            GameCell target = MovementHelper.GetClosestEnemy(character.x, character.y, boardState, character.hero);

            if (target.Range > character.range)
            {
                character.Move();
            }
        }

        foreach (var character in characters)
        {
            character.Attack();
        }

        foreach (var character in characters)
        {
            character.CheckHp();
        }

        Invoke("Turn", gameSpeed);
    }