private void Update() { for (int i = 0; i < this.m_NoBalanceGroups.Count; i++) { HumanAIGroup group = this.m_NoBalanceGroups[i]; if (this.CheckGroup(group)) { break; } } if (this.CanSpawnGroupFromBalanceSystem()) { for (int j = 0; j < this.m_BalancePatrols.Count; j++) { HumanAIPatrol group2 = this.m_BalancePatrols[j]; if (this.CheckPatrol(group2)) { break; } } for (int k = 0; k < this.m_BalanceGroups.Count; k++) { HumanAIGroup group3 = this.m_BalanceGroups[k]; if (this.CheckGroup(group3)) { break; } } } }
private bool CheckPatrol(HumanAIPatrol group) { if (group.m_Active) { return(false); } float num = 0f; AIPathPoint closestPathPoint = group.GetClosestPathPoint(out num); bool flag = closestPathPoint && num <this.m_MaxActivationDistance && num> this.m_MinActivationDistance; if (flag) { group.Activate(); return(true); } return(false); }