Repository navigation
fix: simulate-keyboard press-edge diagnostics no longer report a missing gameplay update on Fixed/Manual input projects #2508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #nullable enable | ||
| #if ULOOP_HAS_INPUT_SYSTEM | ||
| using NUnit.Framework; | ||
| using UnityEngine.InputSystem.LowLevel; | ||
|
|
||
| using io.github.hatayama.UnityCliLoop.FirstPartyTools; | ||
|
|
||
| namespace io.github.hatayama.UnityCliLoop.Tests.Editor | ||
| { | ||
| /// <summary> | ||
| /// Pure unit tests for the gameplay update-type classification shared by press-edge observation and diagnostics. | ||
| /// </summary> | ||
| public sealed class InputUpdateTypeResolverTests | ||
| { | ||
| [TestCase(InputUpdateType.Dynamic)] | ||
| [TestCase(InputUpdateType.Fixed)] | ||
| [TestCase(InputUpdateType.Manual)] | ||
| public void IsGameplayUpdate_WhenGameplayInputUpdateType_ReturnsTrue(InputUpdateType updateType) | ||
| { | ||
| // Verifies every update type gameplay polling can observe a press edge in counts as a gameplay update. | ||
| Assert.That(InputUpdateTypeResolver.IsGameplayUpdate(updateType), Is.True); | ||
| } | ||
|
|
||
| [TestCase(InputUpdateType.Editor)] | ||
| [TestCase(InputUpdateType.None)] | ||
| public void IsGameplayUpdate_WhenNotGameplayInputUpdateType_ReturnsFalse(InputUpdateType updateType) | ||
| { | ||
| // Verifies Editor ticks and the absence of an update are not mistaken for gameplay input updates. | ||
| Assert.That(InputUpdateTypeResolver.IsGameplayUpdate(updateType), Is.False); | ||
| } | ||
| } | ||
| } | ||
| #endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,18 @@ public static bool IsMatch(InputUpdateType current, InputUpdateType expected) | |
| return (current & expected) == expected; | ||
| } | ||
|
|
||
| // A press edge is visible to gameplay polling only when the Input System processed it | ||
| // in one of the player-loop update types; the Editor tick never surfaces | ||
| // wasPressedThisFrame to gameplay Update, and None means no update ran at all. Press-edge | ||
| // observation and its miss diagnostics must agree on this set, otherwise a Fixed or Manual | ||
| // project reads "no gameplay update ran" while its gameplay updates did run. | ||
| public static bool IsGameplayUpdate(InputUpdateType updateType) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: IsGameplayUpdate duplicates the exact Dynamic/Fixed/Manual predicate already inlined in DeferredPlayerLatchSyncDecision.Decide. Since this PR is centralizing the gameplay-update classification in the resolver, have DeferredPlayerLatchSyncDecision call InputUpdateTypeResolver.IsGameplayUpdate instead, so the two can never drift out of sync. Prompt for AI agents |
||
| { | ||
| return updateType == InputUpdateType.Dynamic | ||
| || updateType == InputUpdateType.Fixed | ||
| || updateType == InputUpdateType.Manual; | ||
| } | ||
|
|
||
| public static bool RequiresExplicitUpdate() | ||
| { | ||
| InputSettings? settings = InputSystem.settings; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Do not directly edit the skill-reference copies.
Both files are under directories where direct skill-file edits are prohibited. Revert these changes and update them through the supported source or generation workflow.
.agents/skills/uloop-simulate-keyboard/references/output.md#L20-L26: regenerate this copy from the supported source..claude/skills/uloop-simulate-keyboard/references/output.md#L20-L26: regenerate this copy from the supported source.As per coding guidelines,
{.agents,.claude}/**/*: Do not directly edit skill files under the project-root.agents/or.claude/directories.🧰 Tools
🪛 LanguageTool
[style] ~20-~20: The words ‘observation’ and ‘observed’ are quite similar. Consider replacing ‘observed’ with a different word.
Context: ...s
false(allnullwhen the edge was observed).Messagecarries the same diagnosis ...(VERB_NOUN_SENT_LEVEL_REP)
📍 Affects 2 files
.agents/skills/uloop-simulate-keyboard/references/output.md#L20-L26(this comment).claude/skills/uloop-simulate-keyboard/references/output.md#L20-L26🤖 Prompt for AI Agents
Source: Coding guidelines