コード例 #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();
 }
コード例 #2
0
 public LifeController(float initialhealth, DeathDelegate deathEvent)
 {
     _maxHealth     = initialhealth;
     currentHealth  = _maxHealth;
     _deathDelegate = deathEvent;
 }
コード例 #3
0
ファイル: Owner.cs プロジェクト: Ferret840/Personal_RTS
 public void RemoveOnDeathCall(DeathDelegate _method)
 {
     OnDeathDelegateEvent -= _method;
 }
コード例 #4
0
ファイル: Owner.cs プロジェクト: Ferret840/Personal_RTS
 public void AddOnDeathCall(DeathDelegate _method)
 {
     OnDeathDelegateEvent += _method;
 }
コード例 #5
0
 public void registerDeathCallback(DeathDelegate callback)
 {
     this.callback = callback;
 }
コード例 #6
0
ファイル: CombatTarget.cs プロジェクト: Daratrixx/Flames
 public void UnregisterDeathListener(DeathDelegate d)
 {
     onDeath -= d;
 }
コード例 #7
0
ファイル: CombatTarget.cs プロジェクト: Daratrixx/Flames
 public void RegisterDeathListener(DeathDelegate d)
 {
     onDeath += d;
 }