internal static void NotifyUpdate(NativeInputUpdateType updateType) { NativeUpdateCallback nativeUpdateCallback = NativeInputSystem.onUpdate; if (nativeUpdateCallback != null) { nativeUpdateCallback(updateType); } }
internal static void NotifyBeforeUpdate(NativeInputUpdateType updateType) { NativeBeforeUpdateCallback callback = onBeforeUpdate; if (callback != null) { callback(updateType); } }
internal static void NotifyUpdate(NativeInputUpdateType updateType, int eventCount, IntPtr eventData) { NativeUpdateCallback callback = onUpdate; if (callback != null) { callback(updateType, eventCount, eventData); } }
internal static void NotifyBeforeUpdate(NativeInputUpdateType updateType) { Action <NativeInputUpdateType> action = NativeInputSystem.onBeforeUpdate; bool flag = action != null; if (flag) { action(updateType); } }
internal static bool ShouldRunUpdate(NativeInputUpdateType updateType) { NativeShouldRunUpdateCallback callback = onShouldRunUpdate; if (callback != null) { return(callback(updateType)); } return(false); }
internal static bool ShouldRunUpdate(NativeInputUpdateType updateType) { NativeShouldRunUpdateCallback callback = onShouldRunUpdate; if (callback != null) { return(callback(updateType)); } // Transitional code path. Remove this when we have onShouldRunUpdate implemented // in the supported input package versions. return(ShouldUpdateFallback(updateType)); }
internal static unsafe void NotifyUpdate(NativeInputUpdateType updateType, IntPtr eventBuffer) { NativeUpdateCallback callback = onUpdate; var eventBufferPtr = (NativeInputEventBuffer *)eventBuffer.ToPointer(); if (callback == null) { eventBufferPtr->eventCount = 0; eventBufferPtr->sizeInBytes = 0; } else { callback(updateType, eventBufferPtr); } }
internal unsafe static void NotifyUpdate(NativeInputUpdateType updateType, IntPtr eventBuffer) { NativeUpdateCallback nativeUpdateCallback = NativeInputSystem.onUpdate; NativeInputEventBuffer *ptr = (NativeInputEventBuffer *)eventBuffer.ToPointer(); bool flag = nativeUpdateCallback == null; if (flag) { ptr->eventCount = 0; ptr->sizeInBytes = 0; } else { nativeUpdateCallback(updateType, ptr); } }
internal static void ShouldRunUpdate(NativeInputUpdateType updateType, out bool retval) { NativeShouldRunUpdateCallback callback = onShouldRunUpdate; retval = callback != null?callback(updateType) : false; }
internal static void ShouldRunUpdate(NativeInputUpdateType updateType, out bool retval) { Func <NativeInputUpdateType, bool> func = NativeInputSystem.onShouldRunUpdate; retval = (func == null || func(updateType)); }
private void OnUpdate(NativeInputUpdateType requestedUpdateType) { #if UNITY_EDITOR var gameIsPlayingAndHasFocus = UnityEditor.EditorApplication.isPlaying && Application.isFocused; #endif currentUpdateType = requestedUpdateType; switch (currentUpdateType) { // NOTE: BeginFixed and BeginDynamic have to set InputSystem.isActive for the time period // until the *next* BeginFixed/BeginDynamic and not just to EndFixed/EndDynamic. This // is because the game code for fixed and dynamic updates runs *after* the respective // end update notification. case NativeInputUpdateType.BeginFixed: #if UNITY_EDITOR InputSystem.isActive = gameIsPlayingAndHasFocus; #endif if (InputSystem.isActive) { eventManager.handlerRoot.BeginUpdate(); } break; case NativeInputUpdateType.EndFixed: if (InputSystem.isActive) { eventManager.handlerRoot.EndUpdate(); } break; case NativeInputUpdateType.BeginDynamic: #if UNITY_EDITOR InputSystem.isActive = gameIsPlayingAndHasFocus; #endif if (InputSystem.isActive) { eventManager.handlerRoot.BeginUpdate(); } break; case NativeInputUpdateType.EndDynamic: if (InputSystem.isActive) { eventManager.handlerRoot.EndUpdate(); } break; case NativeInputUpdateType.BeginBeforeRender: // we only require that the update type is correctly set BeginBeforeRender break; case NativeInputUpdateType.EndBeforeRender: deviceManager.PostProcess(); break; #if UNITY_EDITOR case NativeInputUpdateType.BeginEditor: InputSystem.isActive = !gameIsPlayingAndHasFocus; if (InputSystem.isActive) { eventManager.handlerRoot.BeginUpdate(); } break; case NativeInputUpdateType.EndEditor: if (InputSystem.isActive) { eventManager.handlerRoot.EndUpdate(); } break; #endif } }
private static extern void Update(NativeInputUpdateType updateType);
public static extern void SetUpdateMask(NativeInputUpdateType mask);
internal static void NotifyUpdate(NativeInputUpdateType updateType) { onUpdate?.Invoke(updateType); }
public static extern void Update(NativeInputUpdateType updateType);
public static void SetUpdateMask(NativeInputUpdateType mask) { }
internal static extern bool ShouldUpdateFallback(NativeInputUpdateType updateType);