Skip to content

Commit 65b20c9

Browse files
committed
removed redundant frame from InputActionState and InputAction
1 parent 94b59a1 commit 65b20c9

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ public unsafe bool WasPressed()
12991299
{
13001300
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
13011301
var currentUpdateStep = InputUpdate.s_UpdateStepCount;
1302-
return actionStatePtr->pressedInUpdate == currentUpdateStep && currentUpdateStep != default && actionStatePtr->frame == ExpectedFrame(); // TODO maybe remove frame check?
1302+
return actionStatePtr->pressedInUpdate == currentUpdateStep && currentUpdateStep != default;
13031303
}
13041304

13051305
return false;
@@ -1386,7 +1386,7 @@ public unsafe bool WasReleased()
13861386
{
13871387
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
13881388
var currentUpdateStep = InputUpdate.s_UpdateStepCount;
1389-
return actionStatePtr->releasedInUpdate == currentUpdateStep && currentUpdateStep != default && actionStatePtr->frame == ExpectedFrame(); // TODO maybe remove frame check?
1389+
return actionStatePtr->releasedInUpdate == currentUpdateStep && currentUpdateStep != default;
13901390
}
13911391

13921392
return false;
@@ -1481,7 +1481,7 @@ public unsafe bool WasPerformed()
14811481
{
14821482
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
14831483
var currentUpdateStep = InputUpdate.s_UpdateStepCount;
1484-
return actionStatePtr->lastPerformedInUpdate == currentUpdateStep && currentUpdateStep != default && actionStatePtr->frame == ExpectedFrame(); // TODO maybe remove frame check?
1484+
return actionStatePtr->lastPerformedInUpdate == currentUpdateStep && currentUpdateStep != default;
14851485
}
14861486

14871487
return false;
@@ -1595,7 +1595,7 @@ public unsafe bool WasCompleted()
15951595
{
15961596
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
15971597
var currentUpdateStep = InputUpdate.s_UpdateStepCount;
1598-
return actionStatePtr->lastCompletedInUpdate == currentUpdateStep && currentUpdateStep != default && actionStatePtr->frame == ExpectedFrame();
1598+
return actionStatePtr->lastCompletedInUpdate == currentUpdateStep && currentUpdateStep != default;
15991599
}
16001600

16011601
return false;

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,6 @@ private void RestoreActionStatesAfterReResolvingBindings(UnmanagedMemory oldStat
564564
newActionState.framePressed = oldActionState.framePressed;
565565
newActionState.frameReleased = oldActionState.frameReleased;
566566
newActionState.bindingIndex = oldActionState.bindingIndex;
567-
newActionState.frame = oldActionState.frame;
568567

569568
if (oldActionState.phase != InputActionPhase.Disabled)
570569
{
@@ -893,7 +892,6 @@ public void ResetActionState(int actionIndex, InputActionPhase toPhase = InputAc
893892
actionState->frameCompleted = default;
894893
actionState->framePressed = default;
895894
actionState->frameReleased = default;
896-
actionState->frame = default;
897895
}
898896

899897
Debug.Assert(!actionState->isStarted, "Cannot reset an action to started phase");
@@ -1574,7 +1572,6 @@ private void ProcessButtonState(ref TriggerState trigger, int actionIndex, Bindi
15741572
actionState->framePressed = Time.frameCount;
15751573
actionState->pressedInUpdate = InputUpdate.s_UpdateStepCount;
15761574
actionState->isPressed = true;
1577-
actionState->frame = Time.frameCount;
15781575
}
15791576
else if (actionState->isPressed)
15801577
{
@@ -1584,7 +1581,6 @@ private void ProcessButtonState(ref TriggerState trigger, int actionIndex, Bindi
15841581
actionState->frameReleased = Time.frameCount;
15851582
actionState->releasedInUpdate = InputUpdate.s_UpdateStepCount;
15861583
actionState->isPressed = false;
1587-
actionState->frame = Time.frameCount;
15881584
}
15891585
}
15901586
}
@@ -2443,7 +2439,6 @@ private void ChangePhaseOfActionInternal(int actionIndex, TriggerState* actionSt
24432439
newState.magnitude = 0f;
24442440

24452441
newState.phase = newPhase;
2446-
newState.frame = Time.frameCount;
24472442
if (newPhase == InputActionPhase.Performed)
24482443
{
24492444
newState.framePerformed = Time.frameCount;
@@ -3822,12 +3817,6 @@ public uint lastPerformedInUpdate
38223817
set => m_LastPerformedInUpdate = value;
38233818
}
38243819

3825-
internal int frame
3826-
{
3827-
get => m_Frame;
3828-
set => m_Frame = value;
3829-
}
3830-
38313820
internal int framePerformed
38323821
{
38333822
get => m_FramePerformed;

0 commit comments

Comments
 (0)