void OnCollisionEnter2D(Collision2D collision) { DamageDealer damageDealer; if (null != (damageDealer = collision.gameObject.GetComponent <DamageDealer>())) { TakeDamage(damageDealer.damage); damageEffect.UpdateDamageEffect(); } }
void OnCollisionEnter2D(Collision2D collision) { DamageDealer damageDealer; if (null != (damageDealer = collision.gameObject.GetComponent <DamageDealer>())) { TakeDamage(damageDealer.damage); damageEffect.UpdateDamageEffect(); } }