AbstractDevicePartManipulation.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  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. public virtual void OneDevicePartInit(Dictionary<InputDevicePartType, SCPointEventData> eventDataDic, Transform targetTransform, MoveLogic moveLogic, RotateLogic rotateLogic, ScaleLogic scaleLogic)
  14. {
  15. this.eventDataDic = eventDataDic;
  16. this.targetTransform = targetTransform;
  17. this.moveLogic = moveLogic;
  18. this.rotateLogic = rotateLogic;
  19. this.scaleLogic = scaleLogic;
  20. }
  21. public abstract Tuple<Vector3, Quaternion, Vector3> OneDevicePartUpdate();
  22. public virtual void TwoDevicePartInit(Dictionary<InputDevicePartType, SCPointEventData> eventDataDic, Transform targetTransform, MoveLogic moveLogic, RotateLogic rotateLogic, ScaleLogic scaleLogic)
  23. {
  24. this.eventDataDic = eventDataDic;
  25. this.targetTransform = targetTransform;
  26. this.moveLogic = moveLogic;
  27. this.rotateLogic = rotateLogic;
  28. this.scaleLogic = scaleLogic;
  29. }
  30. public abstract Tuple<Vector3, Quaternion, Vector3> TwoDevicePartUpdate(Func<Vector3, Vector3> scaleConstraint);
  31. }