protected override void Colliding(Behaviour1D other) { if (other is ChomperBehaviour) { Damaged(other); } }
protected override void Colliding(Behaviour1D other) { var damageable = other as IDamageable; if (damageable != null) { damageable.Damaged(this); } }
public void Damaged(Behaviour1D damager) { _currentHealth -= 1; if (_currentHealth == 0) { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); } }
public MapEntry Register(int position, Behaviour1D content) { if (!map.ContainsKey(position)) { map.Add(position, new List <MapEntry>()); } MapEntry entry = new MapEntry(); entry.content = content; entry.position = position; map[position].Add(entry); return(entry); }
public void Damaged(Behaviour1D damager) { Destroy(gameObject); }
private void OnEnable() { _target = target as Behaviour1D; }
protected virtual void Colliding(Behaviour1D other) { }