private void DrawCreationMode()
        {
            EditorGUI.BeginChangeCheck();
            GUIStyle popupStyle = new GUIStyle(EditorStyles.popup)
            {
                alignment = TextAnchor.MiddleCenter
            };

            creationMode = (AssetCreationMode)EditorGUILayout.Popup(string.Empty, (int)creationMode, new[] { "Mode : Single", "Mode : Batch" }, popupStyle);
            if (EditorGUI.EndChangeCheck())
            {
                if (creationMode == AssetCreationMode.Single)
                {
                    singleCreationInfo = new List <AssetCreationArgs> {
                        new AssetCreationArgs()
                    };
                    assetIDRange.start = assetIDRange.end = 1;
                    canEditIDs         = true;
                }
            }

            if (creationMode == AssetCreationMode.Batch)
            {
                EditorGUILayout.BeginHorizontal();
                canEditIDs = GUILayout.Toggle(canEditIDs, "Editable IDs", EditorStyles.miniButton, GUILayout.Width(65));

                if (canEditIDs)
                {
                    batchSize = EditorGUILayout.IntField("Batch Size", batchSize);
                    batchSize = Mathf.Clamp(batchSize, 2, int.MaxValue);
                }
                else
                {
                    assetIDRange       = ExtendedGUILayout.IntRange("ID Range", assetIDRange);
                    assetIDRange.start = Mathf.Clamp(assetIDRange.start, 1, GetHighestPossibleID());
                    assetIDRange.end   = Mathf.Clamp(assetIDRange.end, assetIDRange.start + 1, GetHighestPossibleID());
                }

                EditorGUILayout.EndHorizontal();
            }
        }
Beispiel #2
0
        private void OnGUI()
        {
            if (Settings == null)
            {
                DrawNullSettingsMessage();
                return;
            }

            EditorGUI.BeginChangeCheck();
            Settings.State = GUILayout.Toggle(Settings.State, "State", "Button");
            if (EditorGUI.EndChangeCheck())
            {
                if (Settings.State)
                {
                    WorkSaver.ResetSaveDate();
                }

                SceneView.RepaintAll();
            }

            EditorGUILayout.Space();

            EditorGUI.BeginChangeCheck();
            bool editBlinkSettingsToggle = GUILayout.Toggle(editBlinkSettings, "Edit Blink Settings", EditorStyles.miniButton);

            if (EditorGUI.EndChangeCheck())
            {
                if (editBlinkSettingsToggle)
                {
                    if (EditorUtility.DisplayDialog("Edit Blink Settings", "Are you sure you want edit blink settings?", "Ok", "Cancel"))
                    {
                        editBlinkSettings = true;
                    }
                }
                else
                {
                    editBlinkSettings = false;
                }
            }

            if (editBlinkSettings)
            {
                EditorGUILayout.Space();
            }

            EditorGUI.BeginDisabledGroup(!editBlinkSettings);

            Settings.blinkCurve = EditorGUILayout.CurveField("Curve", Settings.blinkCurve);
            EditorGUILayout.Space();

            Settings.startBlinkColor = EditorGUILayout.ColorField("Start Color", Settings.startBlinkColor);
            Settings.endBlinkColor   = EditorGUILayout.ColorField("End Color", Settings.endBlinkColor);
            EditorGUILayout.Space();

            Settings.minBlinkSpeed = EditorGUILayout.FloatField("Min Speed", Settings.minBlinkSpeed);
            Settings.maxBlinkSpeed = EditorGUILayout.FloatField("Max Speed", Settings.maxBlinkSpeed);

            Settings.timeForReachMaxBlinkSpeed = ExtendedGUILayout.TimeObject("Time For Reach Max Speed", Settings.timeForReachMaxBlinkSpeed);
            EditorGUILayout.Space();
            EditorGUI.EndDisabledGroup();

            Settings.timeBetweenSaves = ExtendedGUILayout.TimeObject("Time Between Saves", Settings.timeBetweenSaves);
            EditorGUILayout.Space();

            GUI.backgroundColor = Color.green;
            if (GUILayout.Button("Save Settings"))
            {
                SaveSettings();
            }
            GUI.backgroundColor = Color.white;
        }