Exemple #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.GetComponent <Flock>())
     {
         BoidGroup otherboidGroup = other.GetComponentInParent <BoidGroup>();
         if (otherboidGroup)
         {
             if (!otherboidGroup.isMainGroup)
             {
                 Flock otherFlock = other.GetComponent <Flock>();
                 otherFlock.transform.SetParent(FlockingManager.instance.MainBoids[0].transform.parent);
                 otherFlock.goal  = gameObject;
                 otherFlock.speed = speed;
             }
         }
     }
 }
 protected virtual void Start()
 {
     group  = GetComponent <BoidGroup>();
     m_rule = Rule;
 }