Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            EditorGUI.BeginDisabledGroup(true);
            EditorGUILayout.PropertyField(this.m_Script);
            EditorGUI.EndDisabledGroup();
            serializedObject.Update();
            EditorGUILayout.PropertyField(this.m_WindowName);
            serializedObject.ApplyModifiedProperties();

            if (EditorTools.RightArrowButton(new GUIContent("Bones"), GUILayout.Height(24f)))
            {
                if (InventorySystemEditor.Database == null)
                {
                    InventorySystemEditor.SelectDatabase(delegate { UtilityInstanceWindow.CloseWindow(); ShowBoneMap(); });
                }
                else
                {
                    ShowBoneMap();
                }
            }

            if (EditorTools.RightArrowButton(new GUIContent("Items"), GUILayout.Height(24f)))
            {
                VisibleItemsEditor.ShowWindow("Items", serializedObject.FindProperty("m_VisibleItems"));
            }

            if (EditorWindow.mouseOverWindow != null)
            {
                EditorWindow.mouseOverWindow.Repaint();
            }
        }
Ejemplo n.º 2
0
        private void OnEnable()
        {
            instance = this;

            if (database == null)
            {
                SelectDatabase();
            }
            ResetChildEditors();
        }
Ejemplo n.º 3
0
        public static void ShowWindow()
        {
            InventorySystemEditor[] objArray = Resources.FindObjectsOfTypeAll <InventorySystemEditor> ();
            InventorySystemEditor   editor   = (objArray.Length <= 0 ? ScriptableObject.CreateInstance <InventorySystemEditor> () : objArray [0]);

            editor.hideFlags    = HideFlags.HideAndDontSave;
            editor.minSize      = new Vector2(690, 300);
            editor.titleContent = new GUIContent("Inventory System");
            editor.SelectDatabase();
        }
Ejemplo n.º 4
0
 private void OnDestroy()
 {
     if (childEditors != null)
     {
         for (int i = 0; i < childEditors.Count; i++)
         {
             childEditors[i].OnDestroy();
         }
     }
     instance = null;
 }
Ejemplo n.º 5
0
 private static void OpenItemEditor()
 {
     InventorySystemEditor.ShowWindow();
 }