示例#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
 public void SpawnCreature(creatureType animalType = creatureType.FireBird, int numCreatures = 1)
 {
     for (int i = 0; i < numCreatures; i++)
     {
         GameObject g = prefabs.Find(x => x.GetComponent(animalType.ToString()) != null);
         Instantiate(g);
     }
 }
示例#3
0
 public Creature(string _name, Vector3Int _pos, creatureType _type = creatureType.neutral, CreatureModel _model = CreatureModel.human, CreatureSex _sex = CreatureSex.none, creatureSize _size = creatureSize.medium)
 {
     name  = _name;
     type  = _type;
     model = _model;
     sex   = _sex;
     size  = _size;
     worldSpacePosition = _pos;
 }
示例#4
0
        public void KillAllCreatures(creatureType animalType)
        {
            object            obj             = activeCreatures[0].GetComponent(animalType.ToString());
            List <GameObject> creaturesToKill = activeCreatures.FindAll(x => x.GetComponent(obj.GetType()) != null);

            foreach (GameObject g in creaturesToKill)
            {
                g.GetComponent(obj.GetType()).SendMessage("AutoKillCall");
            }
        }