Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        if (lookForTalk)
        {
            talkT       = GameObject.FindGameObjectWithTag("Dialogue Canvas").GetComponent <DialogueSystem>();
            talkTExists = true;
            lookForTalk = false;
        }

        if (talkTExists)
        {
            //Debug.Log(talkT.currentSentence);
            convoEnd = talkT.End();
        }
        if (canTalk && Input.GetKeyDown(KeyCode.E))
        {
            talking = true;
            canTalk = false;
            canScript.showDialogue(npcName);
            canScript.hidePickUp();
            lookForTalk = true;
        }

        else if (talking && (Input.GetKeyDown(KeyCode.E) || convoEnd))
        {
            Debug.Log(talkTExists);
            canScript.hideDialogue();
            anonCont.setSpeaking(false);
            talking     = false;
            talkT.isEnd = false;
            convoEnd    = false;
            talkTExists = false;
        }
    }