Ejemplo n.º 1
0
    void AssignPos(ICombatDirector e)
    {
        Transform toFollow = GetNearPos(e.CurrentPos(), e.GetDistance());

        e.SetTargetPosDir(toFollow);

        e.SetBool(true);
    }
Ejemplo n.º 2
0
    public void GetNewNearPos(ICombatDirector e)
    {
        Transform pos = e.CurrentTargetPosDir();

        positionsToAttack.Add(pos);

        e.SetTargetPosDir(GetNearPos(e.CurrentPos(), e.GetDistance()));
    }
Ejemplo n.º 3
0
    public void AddToAttack(ICombatDirector e, EntityBase target)
    {
        if (target == head)
        {
            AddOrRemoveToList(e);
        }
        else
        {
            if (listAttackTarget.ContainsKey(target))
            {
                if (listAttackTarget[target].Count >= maxEnemies)
                {
                    e.SetTarget(head);
                    AddOrRemoveToList(e);
                }
                else
                {
                    Transform toFollow = GetNearPos(e.CurrentPos(), target);

                    listAttackTarget[target].Add(e);

                    e.SetTargetPosDir(toFollow);

                    e.SetBool(true);
                }
            }
        }

        if (!run && listAttackTarget.Count > 0)
        {
            foreach (var item in listAttackTarget)
            {
                if (item.Value.Count >= 0)
                {
                    RunDirector();
                    return;
                }
            }
        }
    }