void OnTriggerExit(Collider other) { if (other.tag.Contains("'Door'")) { canFlip = false; } if (other.tag.Contains("'Back'")) { flipType = doors.Back; } if (other.tag.Contains("'Ice'")) { isSliding = false; } if (other.tag.Contains("'Tele")) { teleLoc = Vector3.zero; } if (other.tag.Contains("'Switch'")) { toggleLink = null; } if (other.tag.Contains("'Water'")) { isSwimming = false; } }
private void OnTriggerEnter2D(Collider2D collision) { Key key = collision.GetComponent <Key>(); if (key != null) { addKey(key.GetKeyType()); Destroy(key.gameObject); } doors Doors = collision.GetComponent <doors>(); if (Doors != null) { if (Doors.GetKeyType() == Key.KeyType.None) { Doors.OpenDoor(); } else if (hasKey(Doors.GetKeyType())) { removeKey(Doors.GetKeyType()); Doors.OpenDoor(); } } }
public Door(doors door) { d = door; }