UnityEditor.ModuleUI.GUIMinMaxRange C# (CSharp) Method

GUIMinMaxRange() public static method

public static GUIMinMaxRange ( GUIContent label, UnityEditor.SerializedProperty vec2Prop ) : void
label UnityEngine.GUIContent
vec2Prop UnityEditor.SerializedProperty
return void
        public static void GUIMinMaxRange(GUIContent label, SerializedProperty vec2Prop, params GUILayoutOption[] layoutOptions)
        {
            Rect rect = PrefixLabel(SubtractPopupWidth(GetControlRect(13, layoutOptions)), label);
            float num = (rect.width - 20f) * 0.5f;
            Vector2 vector = vec2Prop.vector2Value;
            rect.width = num;
            rect.xMin -= 20f;
            vector.x = FloatDraggable(rect, vector.x, 1f, 20f, "g7");
            vector.x = Mathf.Clamp(vector.x, 0f, vector.y - 0.01f);
            rect.x += num + 20f;
            vector.y = FloatDraggable(rect, vector.y, 1f, 20f, "g7");
            vector.y = Mathf.Max(vector.x + 0.01f, vector.y);
            vec2Prop.vector2Value = vector;
        }

Usage Example

示例#1
0
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (RotationByVelocityModuleUI.s_Texts == null)
            {
                RotationByVelocityModuleUI.s_Texts = new RotationByVelocityModuleUI.Texts();
            }
            EditorGUI.BeginChangeCheck();
            bool flag = ModuleUI.GUIToggle(RotationByVelocityModuleUI.s_Texts.separateAxes, this.m_SeparateAxes);

            if (EditorGUI.EndChangeCheck())
            {
                if (flag)
                {
                    this.m_Z.RemoveCurveFromEditor();
                }
                else
                {
                    this.m_X.RemoveCurveFromEditor();
                    this.m_Y.RemoveCurveFromEditor();
                    this.m_Z.RemoveCurveFromEditor();
                }
            }
            if (flag)
            {
                this.m_Z.m_DisplayName = RotationByVelocityModuleUI.s_Texts.z;
                base.GUITripleMinMaxCurve(GUIContent.none, RotationByVelocityModuleUI.s_Texts.x, this.m_X, RotationByVelocityModuleUI.s_Texts.y, this.m_Y, RotationByVelocityModuleUI.s_Texts.z, this.m_Z, null);
            }
            else
            {
                this.m_Z.m_DisplayName = RotationByVelocityModuleUI.s_Texts.rotation;
                ModuleUI.GUIMinMaxCurve(RotationByVelocityModuleUI.s_Texts.rotation, this.m_Z);
            }
            ModuleUI.GUIMinMaxRange(RotationByVelocityModuleUI.s_Texts.velocityRange, this.m_Range);
        }
All Usage Examples Of UnityEditor.ModuleUI::GUIMinMaxRange