コード例 #1
0
        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);
            }
        }
コード例 #2
0
 public void OnDamagePlayer()
 {
     DamagePlayer?.Invoke(this, new CollisionEventArgs(Position));
 }