/// <inheritdoc />
        protected override void DrawProperty(NonSerializedAttributeWrapper wrapper, SliderAttribute attribute)
        {
            var type = wrapper.Type;

            if (type == typeof(int))
            {
                wrapper.SetValue(EditorGUILayout.IntSlider((int)wrapper.GetValue(), (int)attribute.MinValue, (int)attribute.MaxValue));
            }
            else if (type == typeof(float))
            {
                wrapper.SetValue(EditorGUILayout.Slider((float)wrapper.GetValue(), attribute.MinValue, attribute.MaxValue));
            }
            else
            {
                NotIntFloat(wrapper);
            }
        }
Exemple #2
0
        /// <inheritdoc />
        protected override void DrawProperty(NonSerializedAttributeWrapper wrapper, ResizableTextAreaAttribute attribute)
        {
            if (wrapper.Type != typeof(string))
            {
                NotString(wrapper);
                return;
            }

            if (DrawField(wrapper.DisplayName, (string)wrapper.GetValue(), out var textAreaValue))
            {
                wrapper.SetValue(textAreaValue);
            }
        }
        /// <inheritdoc />
        protected override void DrawProperty(NonSerializedAttributeWrapper wrapper, MinMaxSliderAttribute attribute)
        {
            if (wrapper.Type != typeof(Vector2))
            {
                NotVector2Field(wrapper);
                return;
            }

            var sliderValue = (Vector2)wrapper.GetValue();

            if (this.DrawProperty(wrapper.DisplayName, ref sliderValue, attribute))
            {
                wrapper.SetValue(sliderValue);
            }
        }