Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         if (dialogueScript.inRange == true)
         {
             if (itemTaken == false)
             {
                 if (dialogueScript.diaManager.onYes == true)
                 {
                     inventoryScript.setSlot(itemPrefab, false);
                     itemTaken = true;
                     dialogueScript.changeDialogue(yesLine3, 2);
                 }
                 else if (dialogueScript.diaManager.onYes == false && dialogueScript.currentLine == 2)
                 {
                     dialogueScript.changeDialogue(noLine3, 2);
                 }
             }
             else if (itemTaken == true)
             {
                 dialogueScript.changeDialogue(takenLine3, 2);
             }
         }
     }
 }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        if (buttonDialogueScript.inRange == true)
        {
            if (doorIsOpen == false)
            {
                if (Input.GetKeyDown(KeyCode.Space))
                {
                    if (dm.onYes == true)
                    {
                        if (inventoryScript.checkInventory(2) == true)
                        {
                            door.SetActive(false);
                            doorIsOpen = true;
                            buttonDialogueScript.hasYesNoChoice = false;
                            soundChimes.Play();
                        }
                        else
                        {
                            soundBaloon.Play();
                        }
                    }
                }
            }
            else if (doorIsOpen == true && Input.GetKeyDown(KeyCode.Space))
            {
                if (counter == 0)
                {
                    buttonDialogueScript.changeDialogue("The door is already open", 0);
                }
                else if (counter == 1)
                {
                    buttonDialogueScript.changeDialogue("Just go through", 0);
                }
                else if (counter == 5)
                {
                    buttonDialogueScript.changeDialogue("Please (^_^)", 0);
                }

                if (counter < 5)
                {
                    counter++;
                }
            }
        }
    }