コード例 #1
0
    private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        // set render camera to main camera
        gameObject.GetComponent <Canvas>().worldCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();

        // if we're not in main scene
        if (!SceneManager.GetActiveScene().name.Equals("MainPlayerScene"))
        {
            // if dice tray is open but moved scenes, close dice tray
            if (diceUIHandler.diceTrayOpen)
            {
                diceUIHandler.OpenCloseDiceTray();
            }

            // deactive main buttons
            spellbookButton.SetActive(false);
            diceButton.SetActive(false);
            inventoryButton.SetActive(false);
            endTurnButton.SetActive(false);
            scanButton.SetActive(false);
        }
        // if we're in the main scene
        else
        {
            spellbookButton.SetActive(true);
            diceButton.SetActive(true);
            inventoryButton.SetActive(true);
            scanButton.SetActive(true);
        }
    }
コード例 #2
0
 public void displayQuestRewards(Quest quest)
 {
     // close dice tray if it's open
     if (SceneManager.GetActiveScene().name.Equals("MainPlayerScene") && GameObject.Find("Dice Tray"))
     {
         DiceUIHandler diceUIHandler = GameObject.Find("Dice Tray").GetComponent <DiceUIHandler>();
         if (diceUIHandler.diceTrayOpen)
         {
             diceUIHandler.OpenCloseDiceTray();
         }
     }
     panelQueue.Enqueue(questRewardPanel.panelID);
     Debug.Log("Queued: " + questRewardPanel.panelID);
     questRewardPanel.DisplayQuestRewards(quest);
     CheckPanelQueue();
 }