예제 #1
0
 private void OnCharacterDamaged(CustomHealth health, float amount, Vector3 position, Vector3 attackerPosition)
 {
     if (this.health == health)
     {
         animal.getDamaged(position, attackerPosition, amount);
     }
 }
예제 #2
0
 private void OnCharacterDefeated(CustomHealth health)
 {
     if (this.health == health)
     {
         controller.BreakDown();
     }
 }
예제 #3
0
        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>();
        }
예제 #4
0
 // Start is called before the first frame update
 void Start()
 {
     health = GetComponent <CustomHealth>();
     animal = GetComponent <Animal>();
     CustomHealth.OnCharacterDamaged += OnCharacterDamaged;
 }
예제 #5
0
 // Start is called before the first frame update
 void Start()
 {
     controller = GetComponent <BlimpController>();
     health     = GetComponent <CustomHealth>();
     CustomHealth.OnCharacterDefeated += OnCharacterDefeated;
 }