void OnTriggerStay2D(Collider2D other) { if (other.tag == "Player" && Input.GetAxis("Jump") != 0) { if (door.isLocked && Inventory.GetSelectedItemName() == "ID Card") { door.Lock(false); animator.SetTrigger("unlocking"); } } }
void OnTriggerStay2D(Collider2D other) { if (other.tag == "Player" && Input.GetAxis("Jump") != 0) { if (door.isLocked) { if (Inventory.GetSelectedItemName() == "ID Card") { door.Lock(false); animator.SetTrigger("unlocking"); audio.PlayOneShot(sfxUnlock); } else { audio.PlayOneShot(sfxLock); Fungus.Flowchart.BroadcastFungusMessage("DeniedAccess"); } } } }