private void OnCharacterDamaged(CustomHealth health, float amount, Vector3 position, Vector3 attackerPosition) { if (this.health == health) { animal.getDamaged(position, attackerPosition, amount); } }
private void OnCharacterDefeated(CustomHealth health) { if (this.health == health) { controller.BreakDown(); } }
void Start() { if (flowchart == null && flowchartName != null && flowchartName.Trim().Length != 0) { flowchart = GameObject.Find("/Fungus/Flowcharts/" + flowchartName).GetComponent <Fungus.Flowchart>(); } behaviorTreeController = GetComponentInParent <BehaviorTreeController>(); health = GetComponentInParent <CustomHealth>(); behaviorTree = GetComponentInParent <BehaviorTree>(); navMeshAgent = GetComponentInParent <NavMeshAgent>(); }
// Start is called before the first frame update void Start() { health = GetComponent <CustomHealth>(); animal = GetComponent <Animal>(); CustomHealth.OnCharacterDamaged += OnCharacterDamaged; }
// Start is called before the first frame update void Start() { controller = GetComponent <BlimpController>(); health = GetComponent <CustomHealth>(); CustomHealth.OnCharacterDefeated += OnCharacterDefeated; }