HandleSliderLine.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using BansheeEngine;
  4. namespace BansheeEditor
  5. {
  6. public class HandleSliderLine : HandleSlider
  7. {
  8. public HandleSliderLine(Vector3 direction, float length, bool fixedScale = true, float snapValue = 0.0f)
  9. {
  10. Internal_CreateInstance(this, direction, length, fixedScale, snapValue);
  11. }
  12. public float Delta
  13. {
  14. get
  15. {
  16. float value;
  17. Internal_GetDelta(mCachedPtr, out value);
  18. return value;
  19. }
  20. }
  21. public Vector3 NewPosition
  22. {
  23. get
  24. {
  25. Vector3 value;
  26. Internal_GetNewPosition(mCachedPtr, out value);
  27. return value;
  28. }
  29. }
  30. [MethodImpl(MethodImplOptions.InternalCall)]
  31. private static extern void Internal_CreateInstance(HandleSliderLine instance, Vector3 direction, float length, bool fixedScale, float snapValue);
  32. [MethodImpl(MethodImplOptions.InternalCall)]
  33. private static extern void Internal_GetDelta(IntPtr nativeInstance, out float value);
  34. [MethodImpl(MethodImplOptions.InternalCall)]
  35. private static extern void Internal_GetNewPosition(IntPtr nativeInstance, out Vector3 value);
  36. }
  37. }