public void Kill(HarmfulObject _obj) { Lives = 0; Dead.SetValue(true); DeathMessage.SetValue(_obj.GetMessage()); m_Body.bodyType = RigidbodyType2D.Static; }
public void Damage(HarmfulObject _obj) { int damage = _obj.GetDamage(); Lives -= damage; if (Lives <= float.Epsilon) { Kill(_obj); } }
// Use this for initialization void Start() { collider = GetComponent <BoxCollider2D>(); CalculateRaySpacing(); harmfulObject = GetComponent <HarmfulObject>(); }