override public void Init( ) { base.Init( ); this.transform.position = initPos; rb.constraints = (RigidbodyConstraints2D.FreezeRotation); if (player) { player.SetPushObj(null); player = null; } }
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); } } } }