public Problem(AnimalHandler animalHandler) { _animalHandler = animalHandler; Animals = new List <Animal> { new Cat(), new Dog() }; }
private void Awake() { //allocate _worldData = new WorldData(); _plantHandler = new PlantHandler(); _tileHandler = new MapHandler(); _animalHandler = new AnimalHandler(); }
void SetInitialReferences() { animalHandler = GetComponent <AnimalHandler>(); if (GetComponent <UnityEngine.AI.NavMeshAgent>() != null) { myNavMeshAgent = GetComponent <UnityEngine.AI.NavMeshAgent>(); } }
void SetInitialReferences() { animalHandler = GetComponent <AnimalHandler>(); if (GetComponent <UnityEngine.AI.NavMeshAgent>() != null) { myNavMeshAgent = GetComponent <UnityEngine.AI.NavMeshAgent>(); } checkRate = Random.Range(0.1f, 0.2f); }
void SetInitialReferences() { animalHandler = GetComponent <AnimalHandler>(); myTransform = transform; if (GetComponent <UnityEngine.AI.NavMeshAgent>() != null) { myNavMeshAgent = GetComponent <UnityEngine.AI.NavMeshAgent>(); } SetFleeTarget(animalHandler.MyFleeTarget); checkRate = Random.Range(0.3f, 0.4f); }
void SetInitialReferences() { animalHandler = GetComponent <AnimalHandler>(); myTransform = transform; if (head == null) { head = myTransform; } checkRate = Random.Range(0.8f, 1.2f); }
public static void Main(string[] args) { List <Animal> animals = new List <Animal>(); animals.Add(new Dog()); animals.Add(new Cat()); var handler = new AnimalHandler(); handler.Pet((dynamic)animals[0]); handler.Pet((dynamic)animals[1]); }
void OfferFood(string foodName, AnimalHandler handler) { Console.WriteLine($"- Who wants a {foodName}?"); var result = handler.Handle(foodName); if (!string.IsNullOrEmpty(result)) { Console.WriteLine($"\t{result}"); } else { Console.WriteLine($"\t{foodName} was left untouched."); } }
void SetInitialReferences() { animalHandler = GetComponent <AnimalHandler>(); CheckHealthFraction(); }
void SetInitialReferences() { enemyMaster = transform.root.GetComponent <AnimalHandler>(); }