Пример #1
0
 public void ActivateCreatureMode(creatureMode mode, creatureType animalType, int creatureIndex)
 {
     if (animalType.ToString() == "FireBird")
     {
         if (mode == creatureMode.random)
         {
             activeCreatures[creatureIndex].GetComponent <FireBird>().status = creatureMode.random;
             activeCreatures[creatureIndex].GetComponent <FireBird>().ExecuteCurrentMode(activeCreatures[creatureIndex].GetComponent <FireBird>().GetRandomPath());
         }
         else if (mode == creatureMode.pathSpecific)
         {
             activeCreatures[creatureIndex].GetComponent <FireBird>().status = creatureMode.pathSpecific;
             activeCreatures[creatureIndex].GetComponent <FireBird>().ExecuteCurrentMode(activeCreatures[creatureIndex].GetComponent <FireBird>().GetSpecificPath());
         }
         else if (mode == creatureMode.playerReact)
         {
             activeCreatures[creatureIndex].GetComponent <FireBird>().status = creatureMode.playerReact;
             activeCreatures[creatureIndex].GetComponent <FireBird>().ExecuteCurrentMode();
         }
     }
     else if (animalType.ToString() == "other animaltype")
     {
         //....similar logic to above
     }
 }
Пример #2
0
        private IEnumerator WaitForDestination(PathArray path, creatureMode mode)
        {
            curDirection = UpdateDirection();
            ActivateHeightVariation();
            yield return(new WaitForSeconds(2f));

            yield return(new WaitUntil(() => NearToTarget() && agent.remainingDistance > 0));

            if (mode == creatureMode.random)
            {
                GoOnRandomPath(path);
            }
            else
            {
                nextPathIndex++;
                GoOnSpecificPath(path);
            }
            yield return(null);
        }