Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

IInputStateChangeMonitor.cs 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ////REVIEW: could have a monitor path where if there's multiple state monitors on the same control with
  2. //// the same listener, the monitor is notified only once but made aware of the multiple triggers
  3. namespace UnityEngine.InputSystem.LowLevel
  4. {
  5. /// <summary>
  6. /// Interface used to monitor input state changes.
  7. /// </summary>
  8. /// <remarks>
  9. /// Use <see cref="InputState.AddChangeMonitor(InputControl,IInputStateChangeMonitor,long,uint)"/> to install a state change monitor receiving state change
  10. /// callbacks for a specific control.
  11. /// </remarks>
  12. /// <seealso cref="InputState.AddChangeMonitor(InputControl,IInputStateChangeMonitor,long,uint)"/>
  13. public interface IInputStateChangeMonitor
  14. {
  15. ////REVIEW: For v2, consider changing the signature of this to put the "was consumed" signal *outside* the eventPtr
  16. /// <summary>
  17. /// Called when the state monitored by a state change monitor has been modified.
  18. /// </summary>
  19. /// <param name="control">Control that is being monitored by the state change monitor and that had its state
  20. /// memory changed.</param>
  21. /// <param name="time">Time on the <see cref="InputEvent.time"/> timeline at which the control state change was received.</param>
  22. /// <param name="eventPtr">If the state change was initiated by a state event (either a <see cref="StateEvent"/>
  23. /// or <see cref="DeltaStateEvent"/>), this is the pointer to that event. Otherwise it is pointer that is still
  24. /// <see cref="InputEventPtr.valid"/>, but refers a "dummy" event that is not a <see cref="StateEvent"/> or <see cref="DeltaStateEvent"/>.</param>
  25. /// <param name="monitorIndex">Index of the monitor as passed to <see cref="InputState.AddChangeMonitor(InputControl,IInputStateChangeMonitor,long,uint)"/>.
  26. /// </param>
  27. /// <remarks>
  28. /// To signal that the state change has been processed by the monitor and that no other pending notifications on the
  29. /// same monitor instance should be sent, set the <see cref="InputEventPtr.handled"/> flag to <c>true</c> on <paramref name="eventPtr"/>.
  30. /// Note, however, that aside from only silencing change monitors on the same <see cref="IInputStateChangeMonitor"/> instance,
  31. /// it also only silences change monitors with the same <c>groupIndex</c> value as supplied to
  32. /// <see cref="InputState.AddChangeMonitor(InputControl,IInputStateChangeMonitor,long,uint)"/>.
  33. /// </remarks>
  34. void NotifyControlStateChanged(InputControl control, double time, InputEventPtr eventPtr, long monitorIndex);
  35. /// <summary>
  36. /// Called when a timeout set on a state change monitor has expired.
  37. /// </summary>
  38. /// <param name="control">Control on which the timeout expired.</param>
  39. /// <param name="time">Input time at which the timer expired. This is the time at which an <see cref="InputSystem.Update"/> is being
  40. /// run whose <see cref="InputState.currentTime"/> is past the time of expiration.</param>
  41. /// <param name="monitorIndex">Index of the monitor as given to <see cref="InputState.AddChangeMonitor(InputControl,IInputStateChangeMonitor,long,uint)"/>.</param>
  42. /// <param name="timerIndex">Index of the timer as given to <see cref="InputState.AddChangeMonitorTimeout"/>.</param>
  43. /// <seealso cref="InputState.AddChangeMonitorTimeout"/>
  44. void NotifyTimerExpired(InputControl control, double time, long monitorIndex, int timerIndex);
  45. }
  46. }