Beispiel #1
0
        public static void DrawSaveFolderPicker()
        {
            if (InventoryScriptableObjectUtility.isPrefabsSaveFolderSet == false || InventoryScriptableObjectUtility.isPrefabsSaveFolderValid == false)
            {
                GUI.color = Color.red;
            }

            EditorGUILayout.BeginHorizontal(Devdog.General2.Editors.EditorStyles.boxStyle);
            EditorGUILayout.LabelField(RucksackConstants.ProductName + " save folder: " + InventoryScriptableObjectUtility.prefabsSaveFolder);
            if (GUILayout.Button("Set path", GUILayout.Width(100)))
            {
                InventoryScriptableObjectUtility.SetPrefabSaveFolder();
            }
            EditorGUILayout.EndHorizontal();
            GUI.color = Color.white;
        }
        protected sealed override void DrawDetail(T item)
        {
            if (InventoryScriptableObjectUtility.isPrefabsSaveFolderSet == false)
            {
                EditorGUILayout.HelpBox("Prefab save folder is not set.", MessageType.Error);
                if (GUILayout.Button("Set prefab save folder"))
                {
                    InventoryScriptableObjectUtility.SetPrefabSaveFolder();
                }

                EditorGUIUtility.labelWidth = 0;
                return;
            }

            EditorGUI.BeginChangeCheck();
            DrawDetailInternal(item);
            if (EditorGUI.EndChangeCheck() && selectedItem != null)
            {
                UnityEditor.EditorUtility.SetDirty(selectedItem);
            }

            previouslySelectedGUIItemName = GUI.GetNameOfFocusedControl();
            EditorGUIUtility.labelWidth   = 0;
        }