Example #1
0
    private void OnTriggerStay(Collider other)
    {
        if (other.gameObject.tag == "Turnip" && !holdingTurnip)
        {
            canPickTurnip = true;
            activeTurnip  = other.gameObject;
        }

        if (other.gameObject.tag == "DialogueTrigger")
        {
            npc = other.gameObject.GetComponent <NPCScript>();
            if (Input.GetButtonDown("Fire1") && !dialogueManager.dialogueWindow.activeSelf)
            {
                other.gameObject.GetComponent <NPCScript>().dialogueIndicator.SetActive(false);
                dialogueManager.dialogueWindow.SetActive(true);
                npc.SetDialogue();
                canMove = false;
                cameraScript.DialogueCamera();
            }
        }
    }