Skip to content

Commit 676ad0f

Browse files
committed
Changed naming from RenderingFrame to DynamicUpdate
1 parent 51b9643 commit 676ad0f

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

Assets/Samples/UIvsGameInput/UIvsGameInputHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void Update()
137137
transform.rotation = default;
138138

139139
// When using a pointer-based control scheme, we engage camera look explicitly.
140-
if (m_ControlStyle != ControlStyle.GamepadJoystick && m_LookEngageAction.WasPressedThisRenderingFrame() && IsPointerInsideScreen())
140+
if (m_ControlStyle != ControlStyle.GamepadJoystick && m_LookEngageAction.WasPressedThisDynamicUpdate() && IsPointerInsideScreen())
141141
EngageCameraControl();
142142

143143
// With gamepad/joystick, we can freely rotate the camera at any time.
@@ -166,14 +166,14 @@ public void Update()
166166
if (m_Mouse != null)
167167
m_MousePositionToWarpToAfterCursorUnlock = m_MousePositionToWarpToAfterCursorUnlock.Value + m_Mouse.delta.ReadValue();
168168

169-
if (m_CancelAction.WasPressedThisRenderingFrame() || !m_LookEngageAction.IsPressed())
169+
if (m_CancelAction.WasPressedThisDynamicUpdate() || !m_LookEngageAction.IsPressed())
170170
DisengageCameraControl();
171171

172172
break;
173173

174174
case State.InMenu:
175175

176-
if (m_CancelAction.WasPressedThisRenderingFrame())
176+
if (m_CancelAction.WasPressedThisDynamicUpdate())
177177
OnContinueClicked();
178178

179179
break;

Assets/Tests/InputSystem/CoreTests_Actions.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,24 @@ public IEnumerator Actions_WasStateReachedThisRenderingFrameOperatesIndependentl
6969
var simpleAction = new InputAction(binding: "<Gamepad>/buttonSouth");
7070
simpleAction.Enable();
7171

72-
Assert.That(simpleAction.WasPerformedThisRenderingFrame(), Is.False);
73-
Assert.That(simpleAction.WasPressedThisRenderingFrame(), Is.False);
74-
Assert.That(simpleAction.WasReleasedThisRenderingFrame(), Is.False);
75-
Assert.That(simpleAction.WasCompletedThisRenderingFrame(), Is.False);
72+
Assert.That(simpleAction.WasPerformedThisDynamicUpdate(), Is.False);
73+
Assert.That(simpleAction.WasPressedThisDynamicUpdate(), Is.False);
74+
Assert.That(simpleAction.WasReleasedThisDynamicUpdate(), Is.False);
75+
Assert.That(simpleAction.WasCompletedThisDynamicUpdate(), Is.False);
7676

7777
PressAndRelease(gamepad.buttonSouth);
7878

7979
yield return null; // InputSystem.Update is called and the action state chenges
8080

81-
Assert.That(simpleAction.WasPerformedThisRenderingFrame(), Is.True);
82-
Assert.That(simpleAction.WasPressedThisRenderingFrame(), Is.True);
83-
Assert.That(simpleAction.WasReleasedThisRenderingFrame(), Is.True);
81+
Assert.That(simpleAction.WasPerformedThisDynamicUpdate(), Is.True);
82+
Assert.That(simpleAction.WasPressedThisDynamicUpdate(), Is.True);
83+
Assert.That(simpleAction.WasReleasedThisDynamicUpdate(), Is.True);
8484

8585
InputSystem.Update(); // a manual update happens between two frames, that does not affect the output of the WasPerformedThisRenderingFrame
8686

87-
Assert.That(simpleAction.WasPerformedThisRenderingFrame(), Is.True);
88-
Assert.That(simpleAction.WasPressedThisRenderingFrame(), Is.True);
89-
Assert.That(simpleAction.WasReleasedThisRenderingFrame(), Is.True);
87+
Assert.That(simpleAction.WasPerformedThisDynamicUpdate(), Is.True);
88+
Assert.That(simpleAction.WasPressedThisDynamicUpdate(), Is.True);
89+
Assert.That(simpleAction.WasReleasedThisDynamicUpdate(), Is.True);
9090

9191
//Reset State
9292
InputSystem.settings.updateMode = updateMode;
@@ -160,13 +160,13 @@ public IEnumerator Actions_WasStateReachedThisFrameAndWasStateReachedThisRenderi
160160

161161
yield return null;
162162

163-
Assert.That(simpleAction.WasPerformedThisRenderingFrame(), Is.True);
164-
Assert.That(simpleAction.WasPressedThisRenderingFrame(), Is.True);
165-
Assert.That(simpleAction.WasReleasedThisRenderingFrame(), Is.True);
163+
Assert.That(simpleAction.WasPerformedThisDynamicUpdate(), Is.True);
164+
Assert.That(simpleAction.WasPressedThisDynamicUpdate(), Is.True);
165+
Assert.That(simpleAction.WasReleasedThisDynamicUpdate(), Is.True);
166166

167167
yield return null;
168168

169-
Assert.That(simpleAction.WasCompletedThisRenderingFrame(), Is.False);
169+
Assert.That(simpleAction.WasCompletedThisDynamicUpdate(), Is.False);
170170

171171
//Reset State
172172
InputSystem.settings.updateMode = updateMode;

Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,10 +1249,10 @@ private int ExpectedFrame()
12491249
/// true for the duration of the frame even if the action was subsequently disabled in the frame.
12501250
///
12511251
/// NOTE: If the <see cref="InputSettings.updateMode"/> is set to <see cref="InputSettings.UpdateMode.ProcessEventsInFixedUpdate"/> or <see cref="InputSettings.UpdateMode.ProcessEventsManually"/> and InputSystem.Update() is not called in
1252-
/// the dynamic Update, use <see cref="WasPressedThisRenderingFrame"/> during dynamic Update instead.
1252+
/// the dynamic Update, use <see cref="WasPressedThisDynamicUpdate"/> during dynamic Update instead.
12531253
/// </remarks>
12541254
/// <seealso cref="IsPressed"/>
1255-
/// <seealso cref="WasPressedThisRenderingFrame"/>
1255+
/// <seealso cref="WasPressedThisDynamicUpdate"/>
12561256
/// <seealso cref="WasReleasedThisFrame"/>
12571257
/// <seealso cref="CallbackContext.ReadValueAsButton"/>
12581258
/// <seealso cref="WasPerformedThisFrame"/>
@@ -1293,7 +1293,7 @@ public unsafe bool WasPressedThisFrame()
12931293
/// <seealso cref="WasReleasedThisFrame"/>
12941294
/// <seealso cref="WasPerformedThisFrame"/>
12951295
/// <seealso cref="InputSettings.updateMode"/>
1296-
public unsafe bool WasPressedThisRenderingFrame()
1296+
public unsafe bool WasPressedThisDynamicUpdate()
12971297
{
12981298
var state = GetOrCreateActionMap().m_State;
12991299
if (state != null)
@@ -1335,10 +1335,10 @@ public unsafe bool WasPressedThisRenderingFrame()
13351335
/// true for the duration of the frame even if the action was subsequently disabled in the frame.
13361336
///
13371337
/// NOTE: If the <see cref="InputSettings.updateMode"/> is set to <see cref="InputSettings.UpdateMode.ProcessEventsInFixedUpdate"/> or <see cref="InputSettings.UpdateMode.ProcessEventsManually"/> and InputSystem.Update() is not called in
1338-
/// the dynamic Update, use <see cref="WasReleasedThisRenderingFrame"/> during dynamic Update instead.
1338+
/// the dynamic Update, use <see cref="WasReleasedThisDynamicUpdate"/> during dynamic Update instead.
13391339
/// </remarks>
13401340
/// <seealso cref="IsPressed"/>
1341-
/// <seealso cref="WasReleasedThisRenderingFrame"/>
1341+
/// <seealso cref="WasReleasedThisDynamicUpdate"/>
13421342
/// <seealso cref="WasPressedThisFrame"/>
13431343
/// <seealso cref="CallbackContext.ReadValueAsButton"/>
13441344
/// <seealso cref="WasCompletedThisFrame"/>
@@ -1380,7 +1380,7 @@ public unsafe bool WasReleasedThisFrame()
13801380
/// <seealso cref="CallbackContext.ReadValueAsButton"/>
13811381
/// <seealso cref="WasCompletedThisFrame"/>
13821382
/// <seealso cref="InputSettings.updateMode"/>
1383-
public unsafe bool WasReleasedThisRenderingFrame()
1383+
public unsafe bool WasReleasedThisDynamicUpdate()
13841384
{
13851385
var state = GetOrCreateActionMap().m_State;
13861386
if (state != null)
@@ -1432,9 +1432,9 @@ public unsafe bool WasReleasedThisRenderingFrame()
14321432
/// true for the duration of the frame even if the action was subsequently disabled in the frame.
14331433
///
14341434
/// NOTE: If the <see cref="InputSettings.updateMode"/> is set to <see cref="InputSettings.UpdateMode.ProcessEventsInFixedUpdate"/> or <see cref="InputSettings.UpdateMode.ProcessEventsManually"/> and InputSystem.Update() is not called in
1435-
/// the dynamic Update, use <see cref="WasPerformedThisRenderingFrame"/> when trying to access in dynamic Update instead.
1435+
/// the dynamic Update, use <see cref="WasPerformedThisDynamicUpdate"/> when trying to access in dynamic Update instead.
14361436
/// </remarks>
1437-
/// <seealso cref="WasPerformedThisRenderingFrame"/>
1437+
/// <seealso cref="WasPerformedThisDynamicUpdate"/>
14381438
/// <seealso cref="WasCompletedThisFrame"/>
14391439
/// <seealso cref="WasPressedThisFrame"/>
14401440
/// <seealso cref="phase"/>
@@ -1474,7 +1474,7 @@ public unsafe bool WasPerformedThisFrame()
14741474
/// <seealso cref="WasPressedThisFrame"/>
14751475
/// <seealso cref="phase"/>
14761476
/// <seealso cref="InputSettings.updateMode"/>
1477-
public unsafe bool WasPerformedThisRenderingFrame()
1477+
public unsafe bool WasPerformedThisDynamicUpdate()
14781478
{
14791479
var state = GetOrCreateActionMap().m_State;
14801480

@@ -1538,7 +1538,7 @@ public unsafe bool WasPerformedThisRenderingFrame()
15381538
/// </para>
15391539
/// <para>
15401540
/// NOTE: If the <see cref="InputSettings.updateMode"/> is set to <see cref="InputSettings.UpdateMode.ProcessEventsInFixedUpdate"/> or <see cref="InputSettings.UpdateMode.ProcessEventsManually"/> and InputSystem.Update() is not called in
1541-
/// the dynamic Update, use <see cref="WasCompletedThisRenderingFrame"/> to access this during dynamic Update instead.
1541+
/// the dynamic Update, use <see cref="WasCompletedThisDynamicUpdate"/> to access this during dynamic Update instead.
15421542
/// </para>
15431543
/// </remarks>
15441544
/// <example>
@@ -1550,7 +1550,7 @@ public unsafe bool WasPerformedThisRenderingFrame()
15501550
/// StopTeleport();
15511551
/// </code>
15521552
/// </example>
1553-
/// <seealso cref="WasCompletedThisRenderingFrame"/>
1553+
/// <seealso cref="WasCompletedThisDynamicUpdate"/>
15541554
/// <seealso cref="WasPerformedThisFrame"/>
15551555
/// <seealso cref="WasReleasedThisFrame"/>
15561556
/// <seealso cref="phase"/>
@@ -1590,7 +1590,7 @@ public unsafe bool WasCompletedThisFrame()
15901590
/// <seealso cref="WasPressedThisFrame"/>
15911591
/// <seealso cref="phase"/>
15921592
/// <seealso cref="InputSettings.updateMode"/>
1593-
public unsafe bool WasCompletedThisRenderingFrame()
1593+
public unsafe bool WasCompletedThisDynamicUpdate()
15941594
{
15951595
var state = GetOrCreateActionMap().m_State;
15961596

Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,9 +914,9 @@ internal void ProcessNavigation(ref NavigationModel navigationState)
914914

915915
data.device = m_SubmitCancelState.device;
916916

917-
if (cancelAction != null && cancelAction.WasPerformedThisRenderingFrame())
917+
if (cancelAction != null && cancelAction.WasPerformedThisDynamicUpdate())
918918
ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.cancelHandler);
919-
if (!data.used && submitAction != null && submitAction.WasPerformedThisRenderingFrame())
919+
if (!data.used && submitAction != null && submitAction.WasPerformedThisDynamicUpdate())
920920
ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.submitHandler);
921921
}
922922
}

0 commit comments

Comments
 (0)