Skip to content

Commit a18b084

Browse files
committed
Adds missing UNITY_EDITOR define
WinPlayer build made to ensure compilation
1 parent a4e21c4 commit a18b084

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Packages/com.unity.inputsystem/InputSystem/Events/InputEventTrace.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,8 +1072,10 @@ public class ReplayController : IDisposable
10721072
private double m_StartTimeAsPerRuntime;
10731073
private int m_AllEventsByTimeIndex = 0;
10741074
private List<InputEventPtr> m_AllEventsByTime;
1075+
#if UNITY_EDITOR
10751076
private bool m_ReplayBypassActive;
10761077
private Action m_ClearReplayBypassCallback;
1078+
#endif
10771079

10781080
internal ReplayController(InputEventTrace trace)
10791081
{
@@ -1090,13 +1092,15 @@ public void Dispose()
10901092
{
10911093
InputSystem.onBeforeUpdate -= OnBeginFrame;
10921094
finished = true;
1095+
#if UNITY_EDITOR
10931096
EndReplayBypass();
1094-
1097+
#endif
10951098
foreach (var device in m_CreatedDevices)
10961099
InputSystem.RemoveDevice(device);
10971100
m_CreatedDevices = default;
10981101
}
10991102

1103+
#if UNITY_EDITOR
11001104
// Signals InputManager to treat events as if game view has focus, bypassing
11011105
// editor focus routing that would otherwise defer pointer/keyboard events to
11021106
// editor updates where they reach the editor UI instead of the game.
@@ -1135,7 +1139,7 @@ private void EndReplayBypass()
11351139
--InputSystem.s_Manager.m_ActiveReplayCount;
11361140
}
11371141
}
1138-
1142+
#endif
11391143
/// <summary>
11401144
/// Replay events recorded from <paramref name="recordedDevice"/> on device <paramref name="playbackDevice"/>.
11411145
/// </summary>
@@ -1291,7 +1295,9 @@ public ReplayController Rewind()
12911295
public ReplayController PlayAllFramesOneByOne()
12921296
{
12931297
finished = false;
1298+
#if UNITY_EDITOR
12941299
BeginReplayBypass();
1300+
#endif
12951301
InputSystem.onBeforeUpdate += OnBeginFrame;
12961302
return this;
12971303
}
@@ -1310,7 +1316,9 @@ public ReplayController PlayAllFramesOneByOne()
13101316
public ReplayController PlayAllEvents()
13111317
{
13121318
finished = false;
1319+
#if UNITY_EDITOR
13131320
BeginReplayBypass();
1321+
#endif
13141322
try
13151323
{
13161324
while (MoveNext(true, out var eventPtr))
@@ -1355,7 +1363,9 @@ public ReplayController PlayAllEventsAccordingToTimestamps()
13551363

13561364
// Start playback.
13571365
finished = false;
1366+
#if UNITY_EDITOR
13581367
BeginReplayBypass();
1368+
#endif
13591369
m_StartTimeAsPerFirstEvent = -1;
13601370
m_AllEventsByTimeIndex = -1;
13611371
InputSystem.onBeforeUpdate += OnBeginFrame;
@@ -1426,9 +1436,11 @@ private void Finished()
14261436
{
14271437
finished = true;
14281438
InputSystem.onBeforeUpdate -= OnBeginFrame;
1439+
#if UNITY_EDITOR
14291440
// Schedule bypass removal for after the next OnUpdate, so any events already
14301441
// queued into the native buffer this frame are still processed with the bypass active.
14311442
ScheduleEndReplayBypass();
1443+
#endif
14321444
m_OnFinished?.Invoke();
14331445
}
14341446

Packages/com.unity.inputsystem/InputSystem/InputManager.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3383,7 +3383,10 @@ private unsafe void ProcessEventBuffer(InputUpdateType updateType, ref InputEven
33833383
// Removal and configuration change events should always be processed.
33843384
// During replay, allow events through for devices disabled due to background
33853385
// focus loss — the replay intentionally re-injects events for those devices.
3386-
if (device != null && !device.enabled && !isReplayActive &&
3386+
if (device != null && !device.enabled &&
3387+
#if UNITY_EDITOR
3388+
!isReplayActive &&
3389+
#endif
33873390
currentEventType != DeviceRemoveEvent.Type &&
33883391
currentEventType != DeviceConfigurationEvent.Type &&
33893392
(device.m_DeviceFlags & (InputDevice.DeviceFlags.DisabledInRuntime |

0 commit comments

Comments
 (0)