private void SetDamage(ISetDamage obj) { if (obj != null) { obj.SetDamage(damage); } }
private void SetDamage(ISetDamage obj) { if (obj == null) { return; } obj.SetDamage(new InfoBulletCollision(_curentDamage, Rigidbody.velocity)); }
/// <summary> /// On collision with any objects rocket will be destroyed /// </summary> /// <param name="collision"></param> private void OnCollisionEnter(Collision collision) { ISetDamage planet = collision.gameObject.GetComponent <ISetDamage>(); if (planet != null) { planet.SetDamage(rocketData.Damage); } Destroy(gameObject); }
private void SetDamage(ISetDamage damage) { damage?.SetDamage(CurrentDamage); }