public void ToggleOptions()
    {
        // Changes behaviour based what item is active

        // Closes dialog box on escape
        if (dialogBox.activeSelf)
        {
            manager.CloseBox();
        }
        // Closes inventory on escape
        else if (inventory.activeSelf)
        {
            inventory.SetActive(false);
        }
        // Toggles options menu on escape
        else
        {
            options       = !options;
            player.rotate = !options;
            optionsMenu.SetActive(options);
            healthBar.SetActive(!options);
            manaBar.SetActive(!options);
            hotbar.SetActive(!options);
            Cursor.visible   = options;
            Cursor.lockState = (options) ? CursorLockMode.None : CursorLockMode.Locked;
        }
    }
    private void AcceptQuest(BaseQuest quest)
    {
        // Disables buttons
        dialogManager.accept.gameObject.SetActive(false);
        dialogManager.decline.gameObject.SetActive(false);

        // Create a copy of the original quest, set it as child to the manager and set it to active
        var temp = Instantiate(quest, this.gameObject.transform);

        temp.state = BaseQuest.QuestState.Active;
        // Adds the new quest to list
        activeQuests.Add(temp);

        // Close dialog
        dialogManager.CloseBox();
    }
示例#3
0
 void OnTriggerExit2D(Collider2D other)
 {
     dMan.CloseBox();
 }