Example #1
0
 // Check if we're inside another player's pen; if so,
 // neutralize the target direction and change pen number.
 void GetInsidePenStatus()
 {
     if (!isFollowingPlayer)
     {
         for (int i = 1; i <= globalObj.numPlayers; i++)
         {
             Pen p = globalObj.GetPlayerPen(i);
             if (p.FencesIntact() && p.InsidePenArea(gameObject))
             {
                 penNumber = i;
                 gameObject.GetComponent <PUN2_AnimalSync>().callUpdatePenNumber(penNumber);
                 globalObj.AddAnimal(i);
                 targetDirection = Vector3.zero;
                 return;
             }
         }
     }
 }