Example #1
0
    static string[] OnWillSaveOrCreateAssets(string[] paths)
    {
        List <string> outPaths = new List <string>();

        for (int i = 0; i < paths.Length; i++)
        {
            bool isSceneAsset = paths[i].ToLower().EndsWith(".unity");

            if (isSceneAsset)
            {
                if (EditorWindow.focusedWindow != null && EditorWindow.focusedWindow.GetType() == typeof(UIDEEditorWindow))
                {
                    UIDEEditorWindow window = (UIDEEditorWindow)EditorWindow.focusedWindow;
                    if (window)
                    {
                        window.OnRequestSave();
                    }
                    else
                    {
                        Debug.LogWarning("Something went wrong!");
                    }
                    continue;
                }
            }

            outPaths.Add(paths[i]);
        }
        return(outPaths.ToArray());
    }
Example #2
0
    static public void Init()
    {
        if (EditorWindow.focusedWindow != null && toggleableWindowTypes.Contains(EditorWindow.focusedWindow.GetType()))
        {
            lastFocusedWindow = EditorWindow.focusedWindow;
        }

        if (EditorWindow.focusedWindow != null && EditorWindow.focusedWindow.GetType() == typeof(UIDEEditorWindow) && lastFocusedWindow != null)
        {
            EditorWindow.FocusWindowIfItsOpen(lastFocusedWindow.GetType());
        }
        else
        {
            UIDEEditorWindow.Get();
        }
    }
    static void OnChangedAsset(string[] importedAssets)
    {
        foreach (var str in importedAssets)
        {
            string pathToLower = str.ToLower();
            bool   isScript    = pathToLower.EndsWith(".cs");
            isScript |= pathToLower.EndsWith(".js");
            isScript |= pathToLower.EndsWith(".boo");

            if (isScript)
            {
                if (EditorWindow.focusedWindow != null && EditorWindow.focusedWindow.GetType() == typeof(UIDEEditorWindow))
                {
                    UIDEEditorWindow window = (UIDEEditorWindow)EditorWindow.focusedWindow;
                    if (window != null)
                    {
                        window.OnReloadScript(str);
                    }
                }
            }
        }
    }
Example #4
0
    public void OnEnable()
    {
        UIDEEditorWindow.current = this;

        EditorApplication.projectWindowItemOnGUI -= OnProjectWindowItemGUI;
        EditorApplication.projectWindowItemOnGUI += OnProjectWindowItemGUI;

        EditorApplication.update -= EditorApplicationUpdate;
        EditorApplication.update += EditorApplicationUpdate;

        EditorApplication.playmodeStateChanged -= OnPlayStateChange;
        EditorApplication.playmodeStateChanged += OnPlayStateChange;

        if (isLoaded)
        {
            return;
        }
        this.autoRepaintOnSceneChange = false;
        this.wantsMouseMove           = true;
        this.Start();
        isLoaded = true;
    }
    public void OnEnable()
    {
        UIDEEditorWindow.current = this;

        EditorApplication.projectWindowItemOnGUI -= OnProjectWindowItemGUI;
        EditorApplication.projectWindowItemOnGUI += OnProjectWindowItemGUI;

        EditorApplication.update -= EditorApplicationUpdate;
        EditorApplication.update += EditorApplicationUpdate;

        EditorApplication.playmodeStateChanged -= OnPlayStateChange;
        EditorApplication.playmodeStateChanged += OnPlayStateChange;

        if (isLoaded) return;
        this.autoRepaintOnSceneChange = false;
        this.wantsMouseMove = true;
        this.Start();
        isLoaded = true;
    }
Example #6
0
 public void OnEnable()
 {
     UIDEEditorWindow.current = this;
     EditorApplication.update -= EditorApplicationUpdate;
     EditorApplication.update += EditorApplicationUpdate;
     //Debug.Log("OnEnable "+isLoaded);
     if (isLoaded) return;
     this.autoRepaintOnSceneChange = false;
     this.wantsMouseMove = true;
     this.Start();
     isLoaded = true;
 }
Example #7
0
    static public UIDEEditorWindow Get()
    {
        UIDEEditorWindow window = (UIDEEditorWindow)EditorWindow.GetWindow(typeof(UIDEEditorWindow), false, "UnIDE");

        return(window);
    }