SphericalJointInspector.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="SphericalJoint"/> component.
  11. /// </summary>
  12. [CustomInspector(typeof(SphericalJoint))]
  13. internal class SphericalJointInspector : JointInspector
  14. {
  15. /// <inheritdoc/>
  16. protected internal override void Initialize()
  17. {
  18. SphericalJoint joint = (SphericalJoint) InspectedObject;
  19. BuildGUI(joint, true);
  20. drawer.AddDefault(joint, typeof(SphericalJoint));
  21. drawer.AddField("Enable limit",
  22. () => joint.HasFlag(SphericalJointFlag.Limit),
  23. x => joint.SetFlag(SphericalJointFlag.Limit, x));
  24. drawer.AddConditional("Limit", () => joint.HasFlag(SphericalJointFlag.Limit));
  25. }
  26. }
  27. /** @} */
  28. }