コード例 #1
0
        /// <summary>
        /// Creates GUI elements for fields specific to the slider joint.
        /// </summary>
        protected void BuildGUI(SliderJoint joint)
        {
            enableLimitField.OnChanged += x =>
            {
                joint.SetFlag(SliderJointFlag.Limit, x);
                MarkAsModified();
                ConfirmModify();

                ToggleLimitFields(x);
            };

            Layout.AddElement(enableLimitField);
            limitLayout = Layout.AddLayoutX();
            {
                limitLayout.AddSpace(10);

                GUILayoutY limitContentsLayout = limitLayout.AddLayoutY();
                limitGUI            = new LimitLinearRangeGUI(joint.Limit, limitContentsLayout, Persistent);
                limitGUI.OnChanged += (x, y) =>
                {
                    joint.Limit = x;
                    joint.Limit.SetBase(y);

                    MarkAsModified();
                };
                limitGUI.OnConfirmed += ConfirmModify;
            }

            ToggleLimitFields(joint.HasFlag(SliderJointFlag.Limit));

            base.BuildGUI(joint, true);
        }
コード例 #2
0
        /// <summary>
        /// Creates GUI elements for fields specific to the slider joint.
        /// </summary>
        protected void BuildGUI(SliderJoint joint)
        {
            enableLimitField.OnChanged += x =>
            {
                joint.EnableLimit = x;
                MarkAsModified();
                ConfirmModify();

                ToggleLimitFields(x);
            };

            Layout.AddElement(enableLimitField);
            limitLayout = Layout.AddLayoutX();
            {
                limitLayout.AddSpace(10);

                GUILayoutY limitContentsLayout = limitLayout.AddLayoutY();
                limitGUI = new LimitLinearRangeGUI(joint.Limit, limitContentsLayout, Persistent);
                limitGUI.OnChanged += (x, y) =>
                {
                    joint.Limit = new LimitLinearRange(x, y);

                    MarkAsModified();
                };
                limitGUI.OnConfirmed += ConfirmModify;
            }

            ToggleLimitFields(joint.EnableLimit);

            base.BuildGUI(joint, true);
        }