Exemple #1
0
            private static eBool PropertyFieldMaster(GUICon label, SerializedProperty property, bool includeChildren, params GUILayOpt[] options)
            {
                if (property.propertyType == SerializedPropertyType.Quaternion)
                {
                    using (var cc = Disposables.ChangeCheck()) {
                        QuaternionPropertyDrawer.Draw(GetControlRect(false, options), property, label);

                        return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), cc.changed));
                    }
                }

                var val = EditorGUILayout.PropertyField(property, includeChildren, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #2
0
        public static eInt DrawActionWithMenu(bool disabled, Rect position, Action <Rect> draw, GUICon label, GUICon[] Options, int active)
        {
            var propRect  = new Rect(position);
            var labelRect = new Rect(position);
            var menuRect  = new Rect(position);

            labelRect     = labelRect.Edit(RectEdit.SubtractY(1), RectEdit.SetWidth(EditorGUIUtility.labelWidth));
            menuRect.xMin = menuRect.xMax - MENU_BUTTON_SIZE;
            menuRect.xMax = position.xMax;
            propRect.xMin = labelRect.xMax;
            propRect.xMax = menuRect.xMin - 2;
            Label(labelRect, label);

            using (Disposables.DisabledScope(disabled))
                draw.Trigger(propRect);

            using (Disposables.SetIndent(0)) {
                var index = EditorGUI.Popup(menuRect, GUICon.none, active, Options, Styles.InLineOptionsMenu);

                return(GUIEvent.Create(position, index));
            }
        }
Exemple #3
0
 public static eInt Popup(Rect pos, string label, int selected, GUICon[] Options) => GUIEvent.Create(pos, EditorGUI.Popup(pos, selected, Options, label));
Exemple #4
0
 public static GUIEvent <Enum> EnumPopup(GUICon label, Enum selected, GUIStyle style, params GUILayOpt[] options) =>
 GUIEvent.Create(EditorGUILayout.EnumPopup(label, selected, style, options));
Exemple #5
0
 public static eInt Popup(GUICon label, int selectedIndex, GUICon[] displayedOptions, GUIStyle style, params GUILayOpt[] options) =>
 GUIEvent.Create(EditorGUILayout.Popup(label, selectedIndex, displayedOptions, style, options));
Exemple #6
0
 public static eInt Popup(int selectedIndex, GUICon[] displayedOptions, params GUILayOpt[] options) =>
 GUIEvent.Create(EditorGUILayout.Popup(selectedIndex, displayedOptions, options));
Exemple #7
0
            public static GUIEvent IntSlider(SerializedProperty property, int leftValue, int rightValue, params GUILayOpt[] options)
            {
                EditorGUILayout.Slider(property, leftValue, rightValue, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect()));
            }
Exemple #8
0
            public static eFloat Slider(string label, float value, float leftValue, float rightValue, params GUILayOpt[] options)
            {
                var val = EditorGUILayout.Slider(label, value, leftValue, rightValue, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #9
0
            public static GUIEvent SelectableLabel(string text, GUIStyle style, params GUILayOpt[] options)
            {
                EditorGUILayout.SelectableLabel(text, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect()));
            }
Exemple #10
0
            private static eBool FoldoutMaster(bool foldout, GUICon guiCon, GUIStyle style, bool toggleOnLabelClick = true)
            {
                var val = EditorGUILayout.Foldout(foldout, guiCon, toggleOnLabelClick, style);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #11
0
            private static eBool ToggleFieldMaster(bool toggle, GUICon guiCon, GUIStyle style, params GUILayOpt[] options)
            {
                var val = EditorGUILayout.Toggle(guiCon, toggle, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #12
0
            private static eBool ButtonMaster(GUICon guiCon, GUIStyle style, params GUILayOpt[] options)
            {
                var b = GUILayout.Button(guiCon, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), b));
            }
Exemple #13
0
 public static GUIEvent <Enum> EnumPopup(Rect pos, GUICon label, Enum selected, GUIStyle style) => GUIEvent.Create(pos, EditorGUI.EnumPopup(pos, label, selected, style));
Exemple #14
0
 public static GUIEvent <Enum> EnumPopup(Rect pos, string label, Enum selected) => GUIEvent.Create(pos, EditorGUI.EnumPopup(pos, label, selected));
Exemple #15
0
 public static eInt Popup(Rect pos, GUICon label, int selected, GUICon[] Options, GUIStyle style) =>
 GUIEvent.Create(pos, EditorGUI.Popup(pos, label, selected, Options, style));
Exemple #16
0
            private static GUIEvent <T> ObjectFieldMaster <T>(GUICon guiCon, T value, bool allowSceneObjects, params GUILayOpt[] options) where T : Object
            {
                var val = (T)EditorGUILayout.ObjectField(guiCon, value, typeof(T), allowSceneObjects, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #17
0
            private static eFloat FloatFieldMaster(GUICon guiCon, float value, GUIStyle style, params GUILayOpt[] options)
            {
                var val = EditorGUILayout.FloatField(guiCon, value, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #18
0
 /// <summary>
 ///     Adds an empty amount of space using Unity calculated spaces.
 ///     Useful for adding non-Layout based drawing in an area
 /// </summary>
 /// <param name="height">Default Height is Unity's Singleline height of 16f</param>
 /// <returns>A new <see cref="GUIEvent" />(<see cref="GetControlRect(GUILayOpt[])" />(GUILayout.Height(height)))</returns>
 public static GUIEvent Space(float height = 16) => GUIEvent.Create(GetControlRect(GUILayout.Height(height)));
Exemple #19
0
            public static eString PasswordFieldMaster(GUICon label, string password, GUIStyle style, params GUILayOpt[] options)
            {
                var val = EditorGUILayout.PasswordField(label, password, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #20
0
            private static eDouble DelayedDoubleFieldMaster(double value, GUIStyle style, params GUILayOpt[] options)
            {
                var val = EditorGUILayout.DelayedDoubleField(value, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #21
0
            public static eInt Slider(GUICon label, int value, int leftValue, int rightValue, params GUILayOpt[] options)
            {
                var val = EditorGUILayout.IntSlider(label, value, leftValue, rightValue, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #22
0
            private static eLong LongFieldMaster(long value, GUIStyle style, params GUILayOpt[] options)
            {
                var val = EditorGUILayout.LongField(value, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #23
0
 public static eInt Popup(int selectedIndex, string[] displayedOptions, GUIStyle style, params GUILayOpt[] options) =>
 GUIEvent.Create(EditorGUILayout.Popup(selectedIndex, displayedOptions, style, options));
Exemple #24
0
            private static eString DelayedTextFieldMaster(GUICon guiCon, string value, GUIStyle style, params GUILayOpt[] options)
            {
                var val = EditorGUILayout.DelayedTextField(guiCon, value, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #25
0
 public static eInt Popup(string label, int selectedIndex, string[] displayedOptions, params GUILayOpt[] options) =>
 GUIEvent.Create(EditorGUILayout.Popup(label, selectedIndex, displayedOptions, options));
Exemple #26
0
            private static eString TextAreaMaster(string value, GUIStyle style, params GUILayOpt[] options)
            {
                var val = EditorGUILayout.TextArea(value, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #27
0
 public static GUIEvent <Enum> EnumPopup(string label, Enum selected, params GUILayOpt[] options) => GUIEvent.Create(EditorGUILayout.EnumPopup(label, selected, options));
Exemple #28
0
            private static eObject RawObjectFieldMaster(GUICon guiCon, Object value, Type type, bool allowSceneObjects, params GUILayOpt[] options)
            {
                var val = EditorGUILayout.ObjectField(guiCon, value, type, allowSceneObjects, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect(), val));
            }
Exemple #29
0
            private static GUIEvent LabelFieldMaster(GUICon guiCon, GUIStyle style, params GUILayOpt[] options)
            {
                EditorGUILayout.LabelField(guiCon, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect()));
            }
Exemple #30
0
 public static eBool FoldoutMaster(Rect rect, bool foldout, GUICon guiCon, GUIStyle style) => GUIEvent.Create(EditorGUI.Foldout(rect, foldout, guiCon, style));