Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

NGUI OnRelease event not receive

Discussion in 'Editor & General Support' started by yushuang, Jun 3, 2020.

  1. yushuang

    yushuang

    Joined:
    Jan 24, 2017
    Posts:
    2
    UICamera.cs
    in function ProcessMouse ( )
    Code (CSharp):
    1. if (Input.GetMouseButtonDown(i))
    2. {
    3.     currentKey = KeyCode.Mouse0 + i;
    4.     justPressed = true;
    5.     isPressed = true;
    6. }
    7. else if (Input.GetMouseButton(i))
    8. {
    9.     currentKey = KeyCode.Mouse0 + i;
    10.     isPressed = true;
    11. }
    this position miss ?
    else if (Input.GetMouseButtonUp(i)) currentKey = KeyCode.Mouse0 + i;
     
  2. yushuang

    yushuang

    Joined:
    Jan 24, 2017
    Posts:
    2
    In the previous frame of the mouse up event, if there is a keyboard event, this state will be maintained until the current frame resulting in the onrelease event and onclick event can not take effect
     
  3. sebastiend-unity

    sebastiend-unity

    Unity Technologies

    Joined:
    Nov 9, 2015
    Posts:
    184