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 } }
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); } }
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; }
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"); } }