diff --git a/GFramework.Game/Routing/RouterBase.cs b/GFramework.Game/Routing/RouterBase.cs index 3fe43f54..efc2799a 100644 --- a/GFramework.Game/Routing/RouterBase.cs +++ b/GFramework.Game/Routing/RouterBase.cs @@ -218,7 +218,7 @@ public abstract class RouterBase : AbstractSystem /// 如果栈中包含指定路由返回 true,否则返回 false public bool Contains(string routeKey) { - return Stack.Any(r => r.Key == routeKey); + return Stack.Any(r => string.Equals(r.Key, routeKey, StringComparison.Ordinal)); } /// @@ -237,7 +237,7 @@ public abstract class RouterBase : AbstractSystem /// 如果栈顶是指定路由返回 true,否则返回 false public bool IsTop(string routeKey) { - return Stack.Count != 0 && Stack.Peek().Key.Equals(routeKey); + return Stack.Count != 0 && string.Equals(Stack.Peek().Key, routeKey, StringComparison.Ordinal); } #endregion diff --git a/GFramework.Game/UI/UiInteractionProfiles.cs b/GFramework.Game/UI/UiInteractionProfiles.cs index 224de6b6..1c30ec87 100644 --- a/GFramework.Game/UI/UiInteractionProfiles.cs +++ b/GFramework.Game/UI/UiInteractionProfiles.cs @@ -51,8 +51,8 @@ public static class UiInteractionProfiles { return action switch { - UiInputAction.Cancel => (profile.CapturedActions & UiInputActionMask.Cancel) != 0, - UiInputAction.Confirm => (profile.CapturedActions & UiInputActionMask.Confirm) != 0, + UiInputAction.Cancel => (profile.CapturedActions & UiInputActionMask.Cancel) != UiInputActionMask.None, + UiInputAction.Confirm => (profile.CapturedActions & UiInputActionMask.Confirm) != UiInputActionMask.None, _ => false }; }