/// <summary> /// Show the dialog box. /// </summary> /// <param name="dialogueBox">GameObject refrence.</param> /// <param name="dialogueData">Data to display on dialog box with buttons name.</param> public static void OpenDialogue(GameObject dialogueBox, DialogueBoxData dialogueData) { dialogueBox.SetActive(true); JMRDialogAbstractBase dialogue = dialogueBox.GetComponent <JMRDialogAbstractBase>(); if (dialogue) { dialogue.DisplayDialogue(dialogueData); } else { JMRLogHandler.LogError("Missing Dialogue Script"); } }
private void Start() { if (target == null) { JMRLogHandler.LogError("JioGlass : target not set"); return; } j_RectTransform = GetComponent <RectTransform>(); if (j_RectTransform == null) { throw new MissingComponentException("RectTransform Missing"); } MapTooltipToGameobject(j_RectTransform); }
public static void SearchByType <T>() where T : UnityEngine.Object { List <T> assets = new List <T>(); string key = string.Format("t:{0}", typeof(T)).ToString().Replace("UnityEngine.", ""); var guids = AssetDatabase.FindAssets(key); for (int i = 0; i < guids.Length; i++) { string assetPath = AssetDatabase.GUIDToAssetPath(guids[i]); T asset = AssetDatabase.LoadAssetAtPath <T>(assetPath); if (asset != null) { assets.Add(asset); JMRLogHandler.Log("Name = " + asset.name); } } }
/// <summary> /// Show the dialog box. /// </summary> /// <param name="dialogueBox">GameObject refrence.</param> /// <param name="buttons">Type of button confirm etc.</param> /// <param name="title">Title to display on dialog.</param> /// <param name="message">Message to display on dialog.</param> public static void OpenDialogue(GameObject dialogueBox, DialogButtonType buttons, string title, string message) { dialogueBox.SetActive(true); JMRDialogAbstractBase dialogue = dialogueBox.GetComponent <JMRDialogAbstractBase>(); if (dialogue) { DialogueBoxData dbData = new DialogueBoxData { Buttons = buttons, Title = title, Message = message }; dialogue.DisplayDialogue(dbData); } else { JMRLogHandler.LogError("Missing Dialogue Script"); } }
/// <summary> /// Close the dialog box on close button click. /// </summary> public void CloseDialogueBox() { OnClosed?.Invoke(DialogueData); gameObject.SetActive(false); JMRLogHandler.Log("Dialogue Box Closed = " + name); }