private void Awake() { this.health = base.transform.root.GetComponentInChildren <animalHealth>(); if (!this.health) { this.health = base.transform.root.GetComponent <animalHealth>(); } }
private void Awake() { this.health = base.transform.root.GetComponentInChildren<animalHealth>(); if (!this.health) { this.health = base.transform.root.GetComponent<animalHealth>(); } }
private void Start() { this.animator = base.GetComponent <Animator>(); PlayMakerFSM[] components = base.gameObject.GetComponents <PlayMakerFSM>(); PlayMakerFSM[] array = components; for (int i = 0; i < array.Length; i++) { PlayMakerFSM playMakerFSM = array[i]; if (playMakerFSM.FsmName == "aiBaseFSM") { this.playMaker = playMakerFSM; } } this.health = base.gameObject.GetComponent <animalHealth>(); }
public void CheckTrappedAnimal() { animalHealth component = base.transform.root.GetComponent <animalHealth>(); if (component != null) { if (component.Trapped && component.Trap != null) { component.Trap.SendMessageUpwards("setAnimalAsDead", SendMessageOptions.DontRequireReceiver); component.Trap = null; component.Trapped = false; } } else if (this._destroyTarget && this._destroyTarget.GetComponent <Fish>() && this._destroyTarget.transform.parent) { this._destroyTarget.transform.parent.SendMessage("removeFishFromTrap", SendMessageOptions.DontRequireReceiver); } }
public static void KillAll() { animalHealth[] array = FindObjectsOfType <animalHealth>(); animalHealth[] array2 = array; for (int i = 0; i < array2.Length; i++) { animalHealth animalHealth = array2[i]; if (animalHealth.gameObject.activeInHierarchy) { animalHealth.SendMessage("Die"); } } lb_Bird[] arrayB = FindObjectsOfType <lb_Bird>(); lb_Bird[] arrayB2 = arrayB; for (int i = 0; i < arrayB2.Length; i++) { lb_Bird birdHealth = arrayB2[i]; if (birdHealth.gameObject.activeInHierarchy) { birdHealth.SendMessage("die"); } } }