Пример #1
0
 private void SetupDialoguePanels()
 {
     if (standardDialogueUISettings.subtitlePanelNumber == SubtitlePanelNumber.Custom &&
         standardDialogueUISettings.customSubtitlePanel != null &&
         Tools.IsPrefab(standardDialogueUISettings.customSubtitlePanel.gameObject))
     {
         // Instantiate subtitle panel from prefab:
         var go = Instantiate(standardDialogueUISettings.customSubtitlePanel.gameObject, transform.position, transform.rotation) as GameObject;
         go.transform.SetParent(transform);
         go.transform.localPosition = standardDialogueUISettings.customSubtitlePanelOffset;
         go.transform.localRotation = Quaternion.identity;
         standardDialogueUISettings.customSubtitlePanel = go.GetComponent <StandardUISubtitlePanel>();
     }
     if (standardDialogueUISettings.menuPanelNumber == MenuPanelNumber.Custom &&
         standardDialogueUISettings.customMenuPanel != null &&
         Tools.IsPrefab(standardDialogueUISettings.customMenuPanel.gameObject))
     {
         // Instantiate menu panel from prefab:
         var go = Instantiate(standardDialogueUISettings.customMenuPanel.gameObject, transform.position, transform.rotation) as GameObject;
         go.transform.SetParent(transform);
         go.transform.localPosition = standardDialogueUISettings.customMenuPanelOffset;
         go.transform.localRotation = Quaternion.identity;
         standardDialogueUISettings.customMenuPanel = go.GetComponent <StandardUIMenuPanel>();
     }
 }
Пример #2
0
 private void SetupBarkUI()
 {
     if (barkUISettings.barkUI != null && Tools.IsPrefab(barkUISettings.barkUI.gameObject))
     {
         // Instantiate bark UI from prefab:
         var go = Instantiate(barkUISettings.barkUI.gameObject) as GameObject;
         go.transform.SetParent(transform);
         go.transform.localPosition = barkUISettings.barkUIOffset;
         go.transform.localRotation = Quaternion.identity;
         barkUISettings.barkUI      = go.GetComponent <AbstractBarkUI>();
     }
 }
Пример #3
0
 public static void HandleUnityUIDialogueUI(UnityUIDialogueUI ui, DialogueSystemController dialogueManager)
 {
     if (ui == null)
     {
         return;
     }
     if (Tools.IsPrefab(ui.gameObject) && (ui.GetComponentInParent <Canvas>() == null))
     {
         if (EditorUtility.DisplayDialog("Unity UI Dialogue UI", "A Unity UI Dialogue UI must be a child of a Canvas. Add a Canvas (if needed) and an instance of the dialogue UI to the Dialogue Manager?", "OK", "Cancel"))
         {
             SetupCanvas(ui, dialogueManager);
         }
         else
         {
             dialogueManager.displaySettings.dialogueUI = null;
         }
     }
 }
 public static void HandleCanvasDialogueUI(CanvasDialogueUI ui, DialogueSystemController dialogueManager)
 {
     if (ui == null)
     {
         return;
     }
     if (Tools.IsPrefab(ui.gameObject) && (ui.GetComponentInParent <Canvas>() == null))
     {
         if (EditorUtility.DisplayDialog("Canvas-Based Dialogue UI", "Would you like to add an instance of this dialogue UI prefab as a child of the Dialogue Manager?",
                                         "Add Instance", "Use Prefab"))
         {
             SetupCanvas(ui, dialogueManager);
         }
         else
         {
             //--- Allow prefabs now: dialogueManager.displaySettings.dialogueUI = null;
         }
     }
 }