Esempio n. 1
0
    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();
    }
Esempio n. 2
0
 void OnInspectorUpdate()
 {
     try
     {
         dialog = GameObject.Find("DialogData").GetComponent <DialogDataMono>();
     }
     catch
     {
         //do nothing
     }
     Repaint();
 }
Esempio n. 3
0
    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!");
            }
        }
    }
Esempio n. 4
0
    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();
    }