示例#1
0
        public override void    Init(NGHubWindow hub)
        {
            base.Init(hub);

            this.content      = new GUIContent(string.IsNullOrEmpty(this.alias) == true ? this.scene : this.alias, this.scene);
            this.isSceneValid = this.IsValid(this.scene);
        }
示例#2
0
        public override void    Init(NGHubWindow hub)
        {
            base.Init(hub);

            this.presetContent1 = new GUIContent("P1", this.presets1.ToString());
            this.presetContent2 = new GUIContent("P2", this.presets2.ToString());
            this.presetContent3 = new GUIContent("P3", this.presets3.ToString());
        }
示例#3
0
        public void     ConvertToWindow()
        {
            this.Close();

            NGHubWindow window = EditorWindow.GetWindow <NGHubWindow>();

            window.position = this.position;
            window.Show();
        }
示例#4
0
        public void     ConvertToDock()
        {
            this.Close();

            NGHubWindow window = ScriptableObject.CreateInstance <NGHubWindow>();

            window.SetDockMode(true);
            window.ShowPopup();
        }
示例#5
0
        public override void    InitDrop(NGHubWindow hub)
        {
            base.InitDrop(hub);

            this.asset   = DragAndDrop.objectReferences[0];
            this.image   = Utility.GetIcon(DragAndDrop.objectReferences[0].GetInstanceID());
            this.text    = DragAndDrop.objectReferences[0].name;
            this.content = new GUIContent(this.text, this.asset != null ? this.asset.name : string.Empty);
        }
示例#6
0
        public override void    InitDrop(NGHubWindow hub)
        {
            base.InitDrop(hub);

            this.scene        = AssetDatabase.GetAssetPath(DragAndDrop.objectReferences[0]);
            this.alias        = DragAndDrop.objectReferences[0].name;
            this.content      = new GUIContent(string.IsNullOrEmpty(this.alias) == true ? this.scene : this.alias, this.scene);
            this.isSceneValid = this.IsValid(this.scene);
        }
示例#7
0
        protected virtual void  OnGUI()
        {
            Rect r = this.position;

            r.x       = 0F;
            r.y       = 0F;
            r.width  -= 1F;
            r.height -= 1F;
            GUILayout.Space(5F);
            Utility.DrawUnfillRect(r, Color.grey);

            EditorGUI.BeginChangeCheck();
            this.component.OnEditionGUI();
            if (EditorGUI.EndChangeCheck() == true)
            {
                NGHubWindow hub = this.editor as NGHubWindow;

                if (hub != null)
                {
                    hub.SaveComponents();
                    hub.Repaint();
                }
                else
                {
                    NGHubEditorWindow editor = this.editor as NGHubEditorWindow;
                    if (editor != null)
                    {
                        editor.Hub.SaveComponents();
                        editor.Hub.Repaint();
                    }
                    else
                    {
                        this.editor.Repaint();
                    }
                }
            }

            if (GUILayout.Button("Close") == true)
            {
                this.Close();
            }

            if (Event.current.type == EventType.Repaint)
            {
                r             = GUILayoutUtility.GetLastRect();
                r.x           = this.position.x;
                r.width       = this.position.width;
                r.yMax        = this.position.y + r.yMax + 5F;
                r.yMin        = this.position.y;
                this.position = r;
            }
        }
示例#8
0
 static NGHubWindow()
 {
     // In the case of NG Hub as dock, the layout won't load it at the second restart. Certainly due to the window's state as Popup, but it does not explain why it only occurs at the second restart.
     EditorApplication.delayCall += () =>
     {
         int forceRecreate = NGEditorPrefs.GetInt(NGHubWindow.ForceRecreateKeyPref + "_" + Application.dataPath, 0);
         NGDiagnostic.Log(NGHubWindow.Title, "ForceRecreate", forceRecreate);
         if (forceRecreate == (int)DockState.ProperlyDisabled && Resources.FindObjectsOfTypeAll <NGHubWindow>().Length == 0)
         {
             NGHubWindow.OpenAsDock();
         }
     };
 }
        public override void    Init(NGHubWindow hub)
        {
            base.Init(hub);

            if (string.IsNullOrEmpty(this.typeString) == false)
            {
                Type type = Type.GetType(this.typeString);

                if (type != null && string.IsNullOrEmpty(this.methodName) == false)
                {
                    this.methodInfo = type.GetMethod(this.methodName, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
                }
            }
        }
示例#10
0
        public static void      OpenAsDock()
        {
            NGHubWindow[] editors = Resources.FindObjectsOfTypeAll <NGHubWindow>();

            for (int i = 0; i < editors.Length; i++)
            {
                if (editors[i].dockedAsMenu == true)
                {
                    return;
                }
                editors[i].Close();
            }

            NGHubWindow window = ScriptableObject.CreateInstance <NGHubWindow>();

            window.SetDockMode(true);
            window.ShowPopup();
        }
示例#11
0
 public void     Init(NGHubWindow source)
 {
     this.source  = source;
     this.minI    = 0;
     this.hiddenI = 0;
 }
示例#12
0
 public virtual void             InitDrop(NGHubWindow hub)
 {
     this.hub = hub;
 }
示例#13
0
 public void     Init(NGHubWindow hub)
 {
     this.hub = hub;
 }
示例#14
0
        public override void    Init(NGHubWindow hub)
        {
            base.Init(hub);

            this.content = new GUIContent(this.text, this.asset != null ? this.asset.name : string.Empty);
        }
示例#15
0
 public void     Init(NGHubWindow source, int i)
 {
     this.source = source;
     this.minI   = i;
 }