void Awake()
 {
     if (EventHit == null)
     {
         EventHit = new HitEvent();
     }
     EventHit.AddListener(BroadcastHit);
 }
Beispiel #2
0
    private void Start()
    {
        _hitEvent.AddListener(arg0 => ReceiveDamage(arg0));

        _DeathEvent.AddListener(() => gameObject.GetComponent <EnemySystem>().enabled = false);
        _DeathEvent.AddListener(() => gameObject.GetComponent <EnemyAttack>().enabled = false);
        _DeathEvent.AddListener(() => gameObject.GetComponent <EnemyHealts>().enabled = false);
        _DeathEvent.AddListener(() => gameObject.GetComponent <Collider>().enabled    = false);
        _DeathEvent.AddListener(() => gameObject.GetComponent <Animator>().SetTrigger(nameAnimator.Dead));
    }
 public void HealthEvent(float value)
 {
     hitEvent.RemoveAllListeners();
     hitEvent.AddListener(HealthEvent);
 }
Beispiel #4
0
 // Listener for hit count
 public void AddHitsEventListener(UnityAction <ScreenSide, int> listener)
 {
     hitEvent.AddListener(listener);
 }
Beispiel #5
0
 private void Start()
 {
     _playerEvent.AddListener(dmg => ApplyDamage(dmg));
     _playerEvent.AddListener(arg0 => HealtsAndEnergy());
     textStats();
 }