DragPointOther.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. using UnityEngine.Rendering;
  4. namespace MeidoPhotoStudio.Plugin
  5. {
  6. public class DragPointBody : DragPointGeneral
  7. {
  8. public bool IsCube;
  9. private bool isIK;
  10. public bool IsIK
  11. {
  12. get => isIK;
  13. set
  14. {
  15. if (isIK != value)
  16. {
  17. isIK = value;
  18. ApplyDragType();
  19. }
  20. }
  21. }
  22. protected override void ApplyDragType()
  23. {
  24. bool enabled = !IsIK && (Transforming || Selecting);
  25. bool select = IsIK && Selecting;
  26. ApplyProperties(enabled || select, IsCube && enabled, false);
  27. if (IsCube) ApplyColours();
  28. }
  29. }
  30. public class DragPointBG : DragPointGeneral
  31. {
  32. public override void Set(Transform myObject)
  33. {
  34. base.Set(myObject);
  35. DefaultPosition = myObject.position;
  36. }
  37. protected override void ApplyDragType()
  38. {
  39. ApplyProperties(Transforming, Transforming, Rotating);
  40. ApplyColours();
  41. }
  42. }
  43. }