예제 #1
0
 override public void Init( )
 {
     base.Init( );
     this.transform.position = initPos;
     rb.constraints          = (RigidbodyConstraints2D.FreezeRotation);
     if (player)
     {
         player.SetPushObj(null);
         player = null;
     }
 }
예제 #2
0
 override protected void CollisionEnter(Collision2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         List <ContactPoint2D> contacts = new List <ContactPoint2D> ( );
         col.GetContacts(contacts);
         foreach (var o in contacts)
         {
             if (o.normal.y == 0)
             {
                 player = GameManager.Instance.Player;
                 player.SetPushObj(this.col);
             }
         }
     }
 }