Exemplo n.º 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));
            }
Exemplo n.º 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));
            }
        }
Exemplo n.º 3
0
 public static eInt Popup(Rect pos, string label, int selected, GUICon[] Options) => GUIEvent.Create(pos, EditorGUI.Popup(pos, selected, Options, label));
Exemplo n.º 4
0
 public static GUIEvent <Enum> EnumPopup(GUICon label, Enum selected, GUIStyle style, params GUILayOpt[] options) =>
 GUIEvent.Create(EditorGUILayout.EnumPopup(label, selected, style, options));
Exemplo n.º 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));
Exemplo n.º 6
0
 public static eInt Popup(int selectedIndex, GUICon[] displayedOptions, params GUILayOpt[] options) =>
 GUIEvent.Create(EditorGUILayout.Popup(selectedIndex, displayedOptions, options));
Exemplo n.º 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()));
            }
Exemplo n.º 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));
            }
Exemplo n.º 9
0
            public static GUIEvent SelectableLabel(string text, GUIStyle style, params GUILayOpt[] options)
            {
                EditorGUILayout.SelectableLabel(text, style, options);

                return(GUIEvent.Create(GUILayoutUtility.GetLastRect()));
            }
Exemplo n.º 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));
            }
Exemplo n.º 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));
            }
Exemplo n.º 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));
            }
Exemplo n.º 13
0
 public static GUIEvent <Enum> EnumPopup(Rect pos, GUICon label, Enum selected, GUIStyle style) => GUIEvent.Create(pos, EditorGUI.EnumPopup(pos, label, selected, style));
Exemplo n.º 14
0
 public static GUIEvent <Enum> EnumPopup(Rect pos, string label, Enum selected) => GUIEvent.Create(pos, EditorGUI.EnumPopup(pos, label, selected));
Exemplo n.º 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));
Exemplo n.º 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));
            }
Exemplo n.º 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));
            }
Exemplo n.º 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)));
Exemplo n.º 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));
            }
Exemplo n.º 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));
            }
Exemplo n.º 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));
            }
Exemplo n.º 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));
            }
Exemplo n.º 23
0
 public static eInt Popup(int selectedIndex, string[] displayedOptions, GUIStyle style, params GUILayOpt[] options) =>
 GUIEvent.Create(EditorGUILayout.Popup(selectedIndex, displayedOptions, style, options));
Exemplo n.º 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));
            }
Exemplo n.º 25
0
 public static eInt Popup(string label, int selectedIndex, string[] displayedOptions, params GUILayOpt[] options) =>
 GUIEvent.Create(EditorGUILayout.Popup(label, selectedIndex, displayedOptions, options));
Exemplo n.º 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));
            }
Exemplo n.º 27
0
 public static GUIEvent <Enum> EnumPopup(string label, Enum selected, params GUILayOpt[] options) => GUIEvent.Create(EditorGUILayout.EnumPopup(label, selected, options));
Exemplo n.º 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));
            }
Exemplo n.º 29
0
            private static GUIEvent LabelFieldMaster(GUICon guiCon, GUIStyle style, params GUILayOpt[] options)
            {
                EditorGUILayout.LabelField(guiCon, style, options);

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