|
@@ -13,8 +13,9 @@ using DG.Tweening;
|
|
|
using BeinLab.Util;
|
|
|
using UnityEngine.EventSystems;
|
|
|
using Studio.Scripts;
|
|
|
+using SC.XR.Unity.Module_InputSystem;
|
|
|
|
|
|
-public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
|
|
|
+public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
|
|
|
{
|
|
|
private DoubleLinkNode<RoomConfig> _dataConfig;
|
|
|
|
|
@@ -32,7 +33,7 @@ public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler
|
|
|
string _passWord;
|
|
|
|
|
|
bool isClick = false;
|
|
|
- float _clickTime = 0.2f;
|
|
|
+ float _clickTime = 0.5f;
|
|
|
float _lastTime = 0;
|
|
|
public bool _isDrag = false;
|
|
|
|
|
@@ -70,6 +71,26 @@ public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler
|
|
|
|
|
|
public static Vector3 itemPos;
|
|
|
|
|
|
+ public void Start()
|
|
|
+ {
|
|
|
+ DispatcherBase.KeyDownDelegateRegister(downEvent);
|
|
|
+ DispatcherBase.KeyUpDelegateRegister(upEvent);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void upEvent(InputKeyCode keyCode, InputDevicePartBase part)
|
|
|
+ {
|
|
|
+ if (part.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject != null && isDown)
|
|
|
+ {
|
|
|
+ isDown = false;
|
|
|
+ if (Time.time - _lastTime <= _clickTime)
|
|
|
+ {
|
|
|
+ ClickSelf();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void downEvent(InputKeyCode keyCode, InputDevicePartBase part)
|
|
|
+ {
|
|
|
+ }
|
|
|
|
|
|
public void Init()
|
|
|
{
|
|
@@ -630,6 +651,8 @@ public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler
|
|
|
|
|
|
private void OnDestroy()
|
|
|
{
|
|
|
+ DispatcherBase.KeyDownDelegateUnRegister(downEvent);
|
|
|
+ DispatcherBase.KeyUpDelegateUnRegister(upEvent);
|
|
|
EventTool._displayDelete -= DisplayDeleteBtn;
|
|
|
|
|
|
WSHandler.Room.OnInit -= onInit;
|
|
@@ -693,9 +716,10 @@ public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler
|
|
|
transform.DOScale(initAV3, 0.1f);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ bool isDown;
|
|
|
public void OnPointerDown(PointerEventData eventData)
|
|
|
{
|
|
|
+ isDown = true;
|
|
|
_lastTime = Time.time;
|
|
|
if (!isHide && !isRoomShow && isInit)
|
|
|
|
|
@@ -706,16 +730,13 @@ public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler
|
|
|
public void OnPointerClick(PointerEventData eventData)
|
|
|
{
|
|
|
|
|
|
- if (Time.time - _lastTime <= _clickTime)
|
|
|
- {
|
|
|
- if (!_isDrag)
|
|
|
- {
|
|
|
- ClickSelf();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
if (!isHide && !isRoomShow && isInit)
|
|
|
|
|
|
transform.DOScale(initAV3, 0.1f);
|
|
|
}
|
|
|
+
|
|
|
+ public void OnPointerUp(PointerEventData eventData)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
}
|