예제 #1
0
 public void OpenDoor()
 {
     if (doorType.Equals(DoorType.Sealed))
     {
         OpenSealedDoor();
     }
 }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (doorType.Equals(DoorType.right))
     {
         collision.transform.position += new Vector3(0 + doorEnterDistance, 0, 0);
     }
     if (doorType.Equals(DoorType.left))
     {
         collision.transform.position += new Vector3(0 - doorEnterDistance, 0, 0);
     }
     if (doorType.Equals(DoorType.top))
     {
         collision.transform.position += new Vector3(0, 0 + doorEnterDistance, 0);
     }
     if (doorType.Equals(DoorType.bottom))
     {
         collision.transform.position += new Vector3(0, 0 - doorEnterDistance, 0);
     }
 }