public void AddMember(RSchmit.AI member)
 {
     if (!members.Contains(member))
     {
         members.Add(member);
     }
 }
 public Unit(GameObject target, RSchmit.AI member)
 {
     this.target = target;
     members     = new List <RSchmit.AI>();
     members.Add(member);
     attackList = new AttackList();
 }
 public void Remove(RSchmit.AI ai)
 {
     if (attackers.Contains(ai))
     {
         attackers.Remove(ai);
     }
 }
 public void Add(RSchmit.AI ai)
 {
     if (!attackers.Contains(ai))
     {
         attackers.Add(ai);
     }
 }
 public RSchmit.AI Pop()
 {
     RSchmit.AI top = null;
     if (attackers.Count > 0)
     {
         top = attackers[0];
         attackers.RemoveAt(0);
     }
     return(top);
 }
 public void Attack()
 {
     if (attackList.Peek() != null && attackList.Count > 0 && attackList.Peek().currentAction == actionType.ATTACK_FINISH)
     {
         RSchmit.AI ai = attackList.Pop();
         ai.Attack();
     }
     else
     {
         attackList.Pop();
     }
 }
    public void AddToUnit(RSchmit.AI member)
    {
        bool added = false;

        foreach (Unit u in units)
        {
            if (u.target == member.m_target)
            {
                u.AddMember(member.GetComponent <RSchmit.AI>());
                added = true;
                break;
            }
        }
        if (!added)
        {
            units.Add(new Unit(member.m_target, member.GetComponent <RSchmit.AI>()));
        }
    }
 void Start()
 {
     m_healthBar = GetComponentInChildren <HealthBar>();
     m_animator  = GetComponent <Animator>();
     AI          = GetComponent <RSchmit.AI>();
 }