예제 #1
0
 override protected void TriggerEnter(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         P.Player p = GameManager.Instance.Player;
         if (p.IsDashing)
         {
             p.ForceStopDash(true);
         }
         if (direction == ESpringDirection.UP)
         {
             p.AddVertVelocity(force.y, true);
         }
         else if (direction == ESpringDirection.DOWN)
         {
             p.AddVertVelocity(force.y, true);
         }
         else if (direction == ESpringDirection.LEFT)
         {
             p.AddHoriVelocity(force.x);
         }
         else if (direction == ESpringDirection.RIGHT)
         {
             p.AddHoriVelocity(force.x);
         }
         animator.SetTrigger("Pop");
         DomainEvents.Raise <OnRingVFX> (new OnRingVFX(transform.position, direction));
     }
 }
예제 #2
0
 override protected void CollisionExit(Collision2D other)
 {
     rb.constraints = (RigidbodyConstraints2D.FreezeRotation);
     if (player)
     {
         player.SetPushObj(null);
         player = null;
     }
 }
예제 #3
0
 override public void Init( )
 {
     base.Init( );
     this.transform.position = initPos;
     rb.constraints          = (RigidbodyConstraints2D.FreezeRotation);
     if (player)
     {
         player.SetPushObj(null);
         player = null;
     }
 }
예제 #4
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);
             }
         }
     }
 }