Esempio n. 1
0
    private void Update()
    {
        if (IsPlayerSeen)
        {
            if (IsEnemyType(EnemyType.Melee))
            {
                mover.MoveToExactTarget(player.transform.position);

                if (autoAttack.IsAttacking)
                {
                    return;
                }
                autoAttack.AutoAttackAtPlayer();
            }
            else
            {
                if (cast.IsCasting)
                {
                    return;
                }

                //TODO move towards player if out of mana
                var spell = cast.ChooseRandomCastable();
                cast.CastSpellAtPlayer(spell);
            }
        }
    }