Exemple #1
0
        private void Start()
        {
            List <HumanAIGroup> componentsDeepChild = General.GetComponentsDeepChild <HumanAIGroup>(base.gameObject);

            for (int i = 0; i < componentsDeepChild.Count; i++)
            {
                HumanAIGroup humanAIGroup = componentsDeepChild[i];
                if (!humanAIGroup.m_ChallengeGroup)
                {
                    if (humanAIGroup.m_FromBalance)
                    {
                        if (humanAIGroup.IsPatrol())
                        {
                            this.m_BalancePatrols.Add((HumanAIPatrol)humanAIGroup);
                        }
                        else
                        {
                            this.m_BalanceGroups.Add(humanAIGroup);
                        }
                    }
                    else
                    {
                        this.m_NoBalanceGroups.Add(humanAIGroup);
                    }
                    humanAIGroup.Initialize();
                    humanAIGroup.gameObject.SetActive(false);
                }
            }
        }
        private bool TrySpawnGroup(HumanAIGroup group)
        {
            bool active = group.m_Active;

            if (group.m_Members.Count == 0)
            {
                return(false);
            }
            bool flag;

            if (group.IsPatrol())
            {
                flag = (((HumanAIPatrol)group).GetClosestPathPointInRange(this.m_MinActivationDistance, this.m_MaxActivationDistance) != null);
            }
            else
            {
                float num = 0f;
                flag = (group.GetClosestMember(out num) && num <this.m_MaxActivationDistance && num> this.m_MinActivationDistance);
            }
            if (flag)
            {
                group.Activate();
                return(true);
            }
            return(false);
        }
Exemple #3
0
 public void OnDestroyGroup(HumanAIGroup group)
 {
     this.m_BalanceGroups.Remove(group);
     if (group.IsPatrol())
     {
         this.m_BalancePatrols.Remove((HumanAIPatrol)group);
     }
     this.m_NoBalanceGroups.Remove(group);
 }