Exemple #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag != "Missile")
     {
         return;
     }
     Destroy(other.gameObject);
     isDead      = true;
     timeOfDeath = Time.time;
     AudioManager.Instance.PlaySound("Explosion");
     DeathDelegate?.Invoke();
 }
 public LifeController(float initialhealth, DeathDelegate deathEvent)
 {
     _maxHealth     = initialhealth;
     currentHealth  = _maxHealth;
     _deathDelegate = deathEvent;
 }
Exemple #3
0
 public void RemoveOnDeathCall(DeathDelegate _method)
 {
     OnDeathDelegateEvent -= _method;
 }
Exemple #4
0
 public void AddOnDeathCall(DeathDelegate _method)
 {
     OnDeathDelegateEvent += _method;
 }
 public void registerDeathCallback(DeathDelegate callback)
 {
     this.callback = callback;
 }
Exemple #6
0
 public void UnregisterDeathListener(DeathDelegate d)
 {
     onDeath -= d;
 }
Exemple #7
0
 public void RegisterDeathListener(DeathDelegate d)
 {
     onDeath += d;
 }