static void CreateNPCWindow() { GameObject temp = GameObject.Find("DialogData"); if (temp == null) { Debug.LogWarning("DialogData not found, creating a new one"); temp = new GameObject(); temp.name = "DialogData"; temp.AddComponent <DialogDataMono>(); dialog = temp.GetComponent <DialogDataMono>(); } else { dialog = temp.GetComponent <DialogDataMono>(); if (dialog == null) { Debug.LogError("Failed to find DialogDataMono on the game object! Fix this!"); } } DialogNPCWindow window = (DialogNPCWindow)EditorWindow.GetWindow(typeof(DialogNPCWindow)); window.Repaint(); }
void OnInspectorUpdate() { try { dialog = GameObject.Find("DialogData").GetComponent <DialogDataMono>(); } catch { //do nothing } Repaint(); }
private static void FindDialog() { GameObject temp = GameObject.Find("DialogData"); if (temp == null) { Debug.LogWarning("DialogData not found, creating a new one"); temp = new GameObject(); temp.name = "DialogData"; temp.AddComponent <DialogDataMono>(); dialog = temp.GetComponent <DialogDataMono>(); } else { dialog = temp.GetComponent <DialogDataMono>(); if (dialog == null) { Debug.LogError("Failed to find DialogDataMono on the game object! Fix this!"); } } }
static void ShowFlagsWindow() { GameObject temp = GameObject.Find("DialogData"); if (temp == null) { Debug.LogWarning("DialogData not found, creating a new one"); temp = new GameObject(); temp.name = "DialogData"; temp.AddComponent <DialogDataMono>(); dialog = temp.GetComponent <DialogDataMono>(); } else { dialog = temp.GetComponent <DialogDataMono>(); if (dialog == null) { Debug.LogError("Found dialogData, but failed to get DialogDataMono component. Fix this!"); } } DialogFlagsWindow window = (DialogFlagsWindow)EditorWindow.GetWindow(typeof(DialogFlagsWindow)); window.Repaint(); }