public override void Interact(GameObject player) { ObjectCollector collector = player.GetComponent <ObjectCollector>(); if (isLocked && collector.CheckQty(keyType) == 0) { FMODUnity.RuntimeManager.PlayOneShot(sfxDoorLocked, transform.position); PlayerDialogueState dialogueState = player.GetComponentInChildren <PlayerDialogueState>(); dialogueState.dialogue = lockedDialogue; dialogueState.GetComponent <ConcurrentStateMachine>().ChangeState(typeof(PlayerDialogueState)); } else if (isLocked && collector.CheckQty(keyType) > 0) { FMODUnity.RuntimeManager.PlayOneShot(sfxDoorUnlocked, transform.position); isLocked = false; collector.UseItem(keyType); lockObject.SetActive(false); } else if (!isLocked) { animator.SetTrigger("Open"); FMODUnity.RuntimeManager.PlayOneShot(sfxDoorOpening, transform.position); } }