Exemplo n.º 1
0
    public static void Open()
    {
        if (!Selection.activeObject)
        {
            return;
        }
        if (Selection.activeObject.GetType() == typeof(UnityEditor.DefaultAsset))
        {
            return;
        }

        if (window == null)
        {
            window =
                EditorWindow.GetWindow <DependenciesGraph>(true, "Dependencies Graph", true);
            if (!EditorPrefs.GetBool("firstOpenDependenciesGraph"))
            {
                int initWidth  = 600;
                int initHeight = 600;
                int x          = (Screen.currentResolution.width - initWidth) / 2;
                int y          = (Screen.currentResolution.height - initHeight) / 2;
                window.position = new Rect(x, y, initWidth, initHeight);
                EditorPrefs.SetBool("firstOpenDependenciesGraph", true);
            }
        }
        else
        {
            window.Analyze();
        }
    }
Exemplo n.º 2
0
 void OnDestroy()
 {
     window = null;
 }