Ejemplo n.º 1
0
 private void OnTriggerStay2D(Collider2D collision)
 {
     if (!isReady || !isActivated)
     {
         return;
     }
     if (isWaitihg)
     {
         isWaitihg = false;
     }
     if (isLocked)
     {
         DisplayGuideLine("Locked!\n The card is needed!");
         return;
     }
     DisplayGuideLine("Press \"E\" to enter the door");
     if (Input.GetKey("e"))
     {
         collision.GetComponent <Rigidbody2D>().velocity = new Vector3(0, 0, 0);
         collision.transform.position = nextDoor.teleportTo() + new Vector2(0, 2);
     }
 }