2
0

SliderJointInspector.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using bs;
  4. namespace bs.Editor
  5. {
  6. /** @addtogroup Inspectors
  7. * @{
  8. */
  9. /// <summary>
  10. /// Renders an inspector for the <see cref="SliderJoint"/> component.
  11. /// </summary>
  12. [CustomInspector(typeof(SliderJoint))]
  13. internal class SliderJointInspector : JointInspector
  14. {
  15. /// <inheritdoc/>
  16. protected internal override void Initialize()
  17. {
  18. SliderJoint joint = (SliderJoint)InspectedObject;
  19. BuildGUI(joint, true);
  20. drawer.AddDefault(joint, typeof(SliderJoint));
  21. drawer.AddField("Enable limit",
  22. () => joint.HasFlag(SliderJointFlag.Limit),
  23. x => joint.SetFlag(SliderJointFlag.Limit, x));
  24. drawer.AddConditional("Limit", () => joint.HasFlag(SliderJointFlag.Limit));
  25. }
  26. }
  27. /** @} */
  28. }