Search Unity

Unity UI Request: Allow IPointerEnterHandler and IPointerExitHandler work with CursorLock

Discussion in 'UGUI & TextMesh Pro' started by yinyinh, Mar 10, 2019.

  1. yinyinh

    yinyinh

    Joined:
    Oct 31, 2018
    Posts:
    17
    So I've been trying to make my own Curved UI. However, in the current Unity version 2018.3.8f1 as of writing, the IPointerEnterHandler and IPointerExitHandler events refuse to work with my custom GraphicsRaycaster when I override the PointerEventData's position to use my own.

    Couldn't figure out what was happening until saw this function
    Code (CSharp):
    1.  
    2. /// <summary>
    3. /// Process movement for the current frame with the given pointer event.
    4. /// </summary>
    5. protected virtual void ProcessMove(PointerEventData pointerEvent)
    6. {
    7.        var targetGO = (Cursor.lockState == CursorLockMode.Locked ? null : pointerEvent.pointerCurrentRaycast.gameObject);
    8.             HandlePointerExitAndEnter(pointerEvent, targetGO);
    9.  }
    10.  
    in
    https://bitbucket.org/Unity-Technol...I/EventSystem/InputModules/?at=2018.3/staging

    PointerInputModule.cs

    Can we get an option to toggle this behavior (if intended) instead of making us duplicate all the code just to remove this line?
    It would be a chore to update a whole chunk of code (both StandardInputModule and PointerInputModule) if there is a new feature in the future.
    Plus, the check only affects Enter and Exit in isolation while clicking and other stuff still works as per normal. I personally think that the cases where a user would want every other event to happen except for Enter and Exit is rare.

    Would anyone be nice enough to look into it?