1234567891011121314151617181920212223242526272829 |
- using SC.XR.Unity.Module_InputSystem;
- using UnityEngine.EventSystems;
- namespace SC.XR.Unity.Module_Keyboard
- {
- public class KeyboardManipulationHandler : PointerHandler
- {
- ManipulationHandler manipulationHandler;
- public override void OnPointerDown(PointerEventData eventData)
- {
- base.OnPointerDown(eventData);
- manipulationHandler = manipulationHandler==null?gameObject.AddComponent<ManipulationHandler>(): manipulationHandler;
- manipulationHandler.enabled = true;
- manipulationHandler.OnPointerDown(eventData);
- GameKey2Dboard gameKey2Dboard = this.GetComponentInParent<GameKey2Dboard>();
- gameKey2Dboard.OnPointerDown?.Invoke(eventData);
- }
- public override void OnPointerUp(PointerEventData eventData)
- {
- base.OnPointerUp(eventData);
- manipulationHandler.enabled = false;
- }
- }
- }
|