protected override void OnCollisionEnter2D(Collision2D col) { if (((col.gameObject.GetComponent <Player>()) != null) && (AllowCollisionDamage)) { DamagePlayer.Invoke(); } // If the mine has hit an object which is not the player, then it will head towards // the player with the chain force, just to add some variation to the game. else { ImpulseToTarget(ChainForce); } }
public void OnDamagePlayer() { DamagePlayer?.Invoke(this, new CollisionEventArgs(Position)); }