AbstractDevicePartManipulation.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using SC.XR.Unity.Module_InputSystem;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. public abstract class AbstractDevicePartManipulation : IDevicePartManipulation
  7. {
  8. protected Dictionary<InputDevicePartType, SCPointEventData> eventDataDic;
  9. protected Transform targetTransform;
  10. protected MoveLogic moveLogic;
  11. protected RotateLogic rotateLogic;
  12. protected ScaleLogic scaleLogic;
  13. protected ManipulationHandler manipulationHandler;
  14. public virtual void OneDevicePartInit(ManipulationHandler manipulationHandler, Dictionary<InputDevicePartType, SCPointEventData> eventDataDic, Transform targetTransform, MoveLogic moveLogic, RotateLogic rotateLogic, ScaleLogic scaleLogic)
  15. {
  16. this.eventDataDic = eventDataDic;
  17. this.targetTransform = targetTransform;
  18. this.moveLogic = moveLogic;
  19. this.rotateLogic = rotateLogic;
  20. this.scaleLogic = scaleLogic;
  21. this.manipulationHandler = manipulationHandler;
  22. }
  23. public abstract Tuple<Vector3, Quaternion, Vector3> OneDevicePartUpdate();
  24. public virtual void TwoDevicePartInit(ManipulationHandler manipulationHandler, Dictionary<InputDevicePartType, SCPointEventData> eventDataDic, Transform targetTransform, MoveLogic moveLogic, RotateLogic rotateLogic, ScaleLogic scaleLogic)
  25. {
  26. this.eventDataDic = eventDataDic;
  27. this.targetTransform = targetTransform;
  28. this.moveLogic = moveLogic;
  29. this.rotateLogic = rotateLogic;
  30. this.scaleLogic = scaleLogic;
  31. this.manipulationHandler = manipulationHandler;
  32. }
  33. public abstract Tuple<Vector3, Quaternion, Vector3> TwoDevicePartUpdate(Func<Vector3, Vector3> scaleConstraint);
  34. }