Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Geting Pointer Event data?

Discussion in 'Input System' started by GregTinga, Jun 12, 2020.

  1. GregTinga

    GregTinga

    Joined:
    Jun 12, 2020
    Posts:
    9
    Anyone know if there is a way in the new Input System to GetLastPointerEventData like you could in the old system? A new way to do it?
     
  2. GregTinga

    GregTinga

    Joined:
    Jun 12, 2020
    Posts:
    9
    Update: At least from my Research, Unless you are managing the data yourself, there is no easy-way to get the data in the desired form,
    But it would be as easy to add this code block to InputSystemUIInoutModule.

    Code (CSharp):
    1.    protected ExtendedPointerEventData GetLastPointerEventData()
    2.         {
    3.             var eventData = default(ExtendedPointerEventData);
    4.             if (m_PointerStates.Capacity > m_PointerStates.length)
    5.             {
    6.                 if (m_PointerStates.length == 0)
    7.                     eventData = m_PointerStates.firstValue.eventData;
    8.                 else
    9.                     eventData = m_PointerStates.additionalValues[m_PointerStates.length - 1].eventData;
    10.             }
    11.  
    12.             return eventData;
    13.         }
    However that package itself would have to be updated to include that addition.