From 62fb4da4625bb9246770720f85b0a910bac0ce0e Mon Sep 17 00:00:00 2001 From: "Rei.K" Date: Sun, 12 Jul 2026 16:43:46 +0900 Subject: [PATCH 1/9] LocalizationService --- .../Runtime/Shared/Services/Interfaces.meta | 3 + .../Interfaces/ILocalizationService.cs | 24 +++++++ .../Interfaces/ILocalizationService.cs.meta | 3 + .../Services/LocalizationServiceBase.cs | 71 +++++++++++++++++++ .../Services/LocalizationServiceBase.cs.meta | 3 + 5 files changed, 104 insertions(+) create mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces.meta create mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces/ILocalizationService.cs create mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces/ILocalizationService.cs.meta create mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Services/LocalizationServiceBase.cs create mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Services/LocalizationServiceBase.cs.meta diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces.meta b/src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces.meta new file mode 100644 index 00000000..f00649d5 --- /dev/null +++ b/src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: dd82cac6cabc487cbb4d122a00721195 +timeCreated: 1783838320 \ No newline at end of file diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces/ILocalizationService.cs b/src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces/ILocalizationService.cs new file mode 100644 index 00000000..048b33b4 --- /dev/null +++ b/src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces/ILocalizationService.cs @@ -0,0 +1,24 @@ +using R3; +using UnityEngine.Localization; + +namespace Game.Shared.Services.Interfaces +{ + public interface ILocalizationService + { + Locale SelectedLocale { get; } + + Observable OnLocaleChanged { get; } + + string GetLocalizedString(string tableName, string localizeKey); + + string GetStringByContextActions(string localizeKey); + + string GetStringByInputControls(string deviceLayoutName, string controlPath, string fallback); + + string GetStringByInteractions(string localizeKey); + + string GetStringByInteractionMessages(string localizeKey); + + string GetStringByUITexts(string localizeKey); + } +} diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces/ILocalizationService.cs.meta b/src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces/ILocalizationService.cs.meta new file mode 100644 index 00000000..42629482 --- /dev/null +++ b/src/Game.Client/Assets/Programs/Runtime/Shared/Services/Interfaces/ILocalizationService.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 04a73b56f27c4cbd858b32a6e2c74974 +timeCreated: 1783838329 \ No newline at end of file diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Services/LocalizationServiceBase.cs b/src/Game.Client/Assets/Programs/Runtime/Shared/Services/LocalizationServiceBase.cs new file mode 100644 index 00000000..23f40f42 --- /dev/null +++ b/src/Game.Client/Assets/Programs/Runtime/Shared/Services/LocalizationServiceBase.cs @@ -0,0 +1,71 @@ +using System; +using Game.Shared.Constants; +using Game.Shared.Services.Interfaces; +using R3; +using UnityEngine.InputSystem; +using UnityEngine.Localization; +using UnityEngine.Localization.Settings; + +namespace Game.Shared.Services +{ + public abstract class LocalizationServiceBase : ILocalizationService + { + public Locale SelectedLocale => LocalizationSettings.SelectedLocale; + + public Observable OnLocaleChanged + => Observable.FromEvent, Locale>( + h => h, + h => LocalizationSettings.SelectedLocaleChanged += h, + h => LocalizationSettings.SelectedLocaleChanged -= h); + + public string GetLocalizedString(string tableName, string localizeKey) + { + var entry = LocalizationSettings.StringDatabase.GetTableEntry(tableName, localizeKey).Entry; + return entry != null ? entry.GetLocalizedString() : null; + } + + public string GetStringByContextActions(string localizeKey) + => GetLocalizedString(LocalizationConstants.ContextActionsTable, localizeKey); + + /// + /// controlPath をキーに InputControls からローカライズ名を引く。 + /// family プレフィックス付きキー → 無印キー → fallback(raw) の順に解決する。 + /// + /// 解決済みコントロールのデバイスレイアウト名(family 判定用。null/空可)。 + /// + /// + public string GetStringByInputControls(string deviceLayoutName, string controlPath, string fallback) + { + if (string.IsNullOrEmpty(controlPath)) return fallback; + + var prefix = ResolveFamilyPrefix(deviceLayoutName); + if (prefix.Length > 0) + { + var localized = GetLocalizedString(LocalizationConstants.InputControlsTable, prefix + controlPath); + if (!string.IsNullOrEmpty(localized)) return localized; + } + + return GetLocalizedString(LocalizationConstants.InputControlsTable, controlPath) ?? fallback; + } + + /// デバイスレイアウトを family プレフィックスへ分類する(未知/未接続は空=無印)。 + private static string ResolveFamilyPrefix(string deviceLayoutName) + { + if (string.IsNullOrEmpty(deviceLayoutName)) return string.Empty; + if (InputSystem.IsFirstLayoutBasedOnSecond(deviceLayoutName, "DualShockGamepad")) return "ps/"; + if (InputSystem.IsFirstLayoutBasedOnSecond(deviceLayoutName, "SwitchProControllerHID")) return "switch/"; + if (InputSystem.IsFirstLayoutBasedOnSecond(deviceLayoutName, "XInputController")) return "xbox/"; + return string.Empty; + } + + public string GetStringByInteractions(string localizeKey) + => GetLocalizedString(LocalizationConstants.InteractionsTable, localizeKey); + + public string GetStringByInteractionMessages(string localizeKey) + => GetLocalizedString(LocalizationConstants.InteractionMessagesTable, localizeKey); + + public string GetStringByUITexts(string localizeKey) + => GetLocalizedString(LocalizationConstants.UITextsTable, localizeKey); + } +} + diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Services/LocalizationServiceBase.cs.meta b/src/Game.Client/Assets/Programs/Runtime/Shared/Services/LocalizationServiceBase.cs.meta new file mode 100644 index 00000000..e31a4d53 --- /dev/null +++ b/src/Game.Client/Assets/Programs/Runtime/Shared/Services/LocalizationServiceBase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0b86c7e4748d4bd4a90130a77d5750a6 +timeCreated: 1783838628 \ No newline at end of file From ddecf972215306fab15a6e50b2d584cd60c43ac2 Mon Sep 17 00:00:00 2001 From: "Rei.K" Date: Sun, 12 Jul 2026 16:44:36 +0900 Subject: [PATCH 2/9] =?UTF-8?q?LocalizationService=E7=99=BB=E9=8C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runtime/MVC/Core/Services/LocalizationService.cs | 8 ++++++++ .../Runtime/MVC/Core/Services/LocalizationService.cs.meta | 3 +++ .../Programs/Runtime/MVC/Horror/HorrorGameLauncher.cs | 5 ++++- .../MVC/ScoreTimeAttack/ScoreTimeAttackGameLauncher.cs | 5 ++++- .../Runtime/Shared/Constants/LocalizationConstants.cs | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/LocalizationService.cs create mode 100644 src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/LocalizationService.cs.meta diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/LocalizationService.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/LocalizationService.cs new file mode 100644 index 00000000..c63a8791 --- /dev/null +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/LocalizationService.cs @@ -0,0 +1,8 @@ +using Game.Shared.Services; + +namespace Game.Core.Services +{ + public class LocalizationService : LocalizationServiceBase, IGameService + { + } +} diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/LocalizationService.cs.meta b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/LocalizationService.cs.meta new file mode 100644 index 00000000..8ca57695 --- /dev/null +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/LocalizationService.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 57a1a758931e43a2a525ea10fc7d399b +timeCreated: 1783839611 \ No newline at end of file diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/HorrorGameLauncher.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/HorrorGameLauncher.cs index be8bbda6..58e54288 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/HorrorGameLauncher.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/HorrorGameLauncher.cs @@ -9,6 +9,7 @@ using Game.Shared.Enums; using Game.Shared.SaveData; using Game.Shared.Services; +using Game.Shared.Services.Interfaces; namespace Game.Horror { @@ -27,6 +28,8 @@ public async UniTask StartupAsync() // 各種サービス取得・初期化 var assetService = new AddressableAssetService(); GameServiceManager.Register(assetService); + var localizationService = new LocalizationService(); + GameServiceManager.Register(localizationService); var dbService = new ScriptableDatabaseService(assetService); GameServiceManager.Register(dbService); @@ -58,7 +61,7 @@ public async UniTask StartupAsync() HorrorOptionHelper.ApplySaveData(optionSaveRepository.Data); // キーリバインドのオーバーライドを起動時に適用 - var inputSystemService = new InputSystemService(); + var inputSystemService = new InputSystemService(localizationService); GameServiceManager.Register(inputSystemService); inputSystemService.LoadBindingOverrides(optionSaveRepository.Data.InputBindingOverridesJson); diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/ScoreTimeAttack/ScoreTimeAttackGameLauncher.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/ScoreTimeAttack/ScoreTimeAttackGameLauncher.cs index 041c139e..d09f41a4 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/ScoreTimeAttack/ScoreTimeAttackGameLauncher.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/ScoreTimeAttack/ScoreTimeAttackGameLauncher.cs @@ -8,6 +8,7 @@ using Game.Shared.Enums; using Game.Shared.SaveData; using Game.Shared.Services; +using Game.Shared.Services.Interfaces; namespace Game.ScoreTimeAttack { @@ -26,6 +27,8 @@ public async UniTask StartupAsync() // 2. 各種サービス取得・初期化 var assetService = new AddressableAssetService(); GameServiceManager.Register(assetService); + var localizationService = new LocalizationService(); + GameServiceManager.Register(localizationService); var masterDataService = new MasterDataService(assetService); await masterDataService.LoadMasterDataAsync(); @@ -35,7 +38,7 @@ public async UniTask StartupAsync() await audioService.LoadAsync(); GameServiceManager.Register(audioService); GameServiceManager.Register(new MessagePipeService()); - var inputSystemService = new InputSystemService(); + var inputSystemService = new InputSystemService(localizationService); GameServiceManager.Register(inputSystemService); // 3. 共通オブジェクト読み込み diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Constants/LocalizationConstants.cs b/src/Game.Client/Assets/Programs/Runtime/Shared/Constants/LocalizationConstants.cs index 1bc934ac..b554360b 100644 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Constants/LocalizationConstants.cs +++ b/src/Game.Client/Assets/Programs/Runtime/Shared/Constants/LocalizationConstants.cs @@ -6,5 +6,6 @@ public static class LocalizationConstants public const string ContextActionsTable = "ContextActions"; public const string InteractionMessagesTable = "InteractionMessages"; public const string InteractionsTable = "Interactions"; + public const string UITextsTable = "UITexts"; } } From 3abfe12d58ce3984b20f1f666f25bf46d8db9922 Mon Sep 17 00:00:00 2001 From: "Rei.K" Date: Sun, 12 Jul 2026 16:44:59 +0900 Subject: [PATCH 3/9] =?UTF-8?q?=E4=BE=9D=E5=AD=98=E8=A7=A3=E6=B1=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InputSystemServiceRebindPlayModeTests.cs | 4 +- .../Abstractions/IInputSystemService.cs | 2 + .../MVC/Core/Services/InputSystemService.cs | 42 +++++++++++++++---- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/Game.Client/Assets/Programs/Editor/Tests/PlayMode/InputSystemServiceRebindPlayModeTests.cs b/src/Game.Client/Assets/Programs/Editor/Tests/PlayMode/InputSystemServiceRebindPlayModeTests.cs index 14dad5b8..fdaca853 100644 --- a/src/Game.Client/Assets/Programs/Editor/Tests/PlayMode/InputSystemServiceRebindPlayModeTests.cs +++ b/src/Game.Client/Assets/Programs/Editor/Tests/PlayMode/InputSystemServiceRebindPlayModeTests.cs @@ -24,7 +24,7 @@ public override void Setup() base.Setup(); _keyboard = InputSystem.AddDevice(); _gamepad = InputSystem.AddDevice(); - _service = new InputSystemService(); + _service = new InputSystemService(new LocalizationService()); } public override void TearDown() @@ -56,7 +56,7 @@ public IEnumerator SaveLoadBindingOverrides_RoundTrip_RestoresOverride() Assert.That(json, Is.Not.Null.And.Not.Empty); // 別インスタンスへロードして再現 - var service2 = new InputSystemService(); + var service2 = new InputSystemService(new LocalizationService()); service2.Startup(); yield return null; service2.LoadBindingOverrides(json); diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/Abstractions/IInputSystemService.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/Abstractions/IInputSystemService.cs index 19c3c34b..5c838dcf 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/Abstractions/IInputSystemService.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/Abstractions/IInputSystemService.cs @@ -30,6 +30,8 @@ public interface IInputSystemService : IGameService Observable OnControlSchemeChanged { get; } + Observable<(InputDevice device, InputDeviceChange deviceChange)> OnDeviceChanged { get; } + Observable OnBindingChanged { get; } /// diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/InputSystemService.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/InputSystemService.cs index 3454437f..049a207e 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/InputSystemService.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/InputSystemService.cs @@ -4,37 +4,45 @@ using Game.Shared.Bootstrap; using Game.Shared.Constants; using Game.Shared.Input; -using Game.Shared.Localization; +using Game.Shared.Services.Interfaces; using R3; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.InputSystem; +using UnityEngine.UI; namespace Game.Core.Services { public class InputSystemService : IInputSystemService, IDisposable { + private readonly ILocalizationService _localizationService; + private ProjectDefaultInputSystem _inputSystem; private bool _isInitialized; + private string _controlScheme = InputControlSchemes.DefaultControlScheme; + private GameObject _selectedGameObject; public ProjectDefaultInputSystem.PlayerActions Player => _inputSystem.Player; public ProjectDefaultInputSystem.UIActions UI => _inputSystem.UI; - public InputActionAsset InputActionAsset => _inputSystem?.asset; - private string _controlScheme = InputControlSchemes.DefaultControlScheme; - private GameObject _selectedGameObject; - private readonly Subject _onControlSchemeChanged = new(); public Observable OnControlSchemeChanged => _onControlSchemeChanged; + public Observable<(InputDevice device, InputDeviceChange deviceChange)> OnDeviceChanged + => Observable.FromEvent, (InputDevice, InputDeviceChange)>( + h => (a, b) => h((a, b)), + h => InputSystem.onDeviceChange += h, + h => InputSystem.onDeviceChange -= h); + private readonly Subject _onBindingChanged = new(); public Observable OnBindingChanged => _onBindingChanged; #region Setup - public InputSystemService() + public InputSystemService(ILocalizationService localizationService) { + _localizationService = localizationService; } public void Startup() @@ -112,9 +120,9 @@ public IDisposable BlockInputActions(params InputAction[] actions) #endregion - public void ResolveSelectable(GameObject selectedGameObject = null) + private void ResolveSelectable(GameObject selectedGameObject = null) { - var allSelectables = InputSystemHelper.GetAllSelectables(); + var allSelectables = GetAllSelectables(); if (allSelectables.Length > 0) { GameObject go = null; @@ -149,6 +157,22 @@ public void ResolveSelectable(GameObject selectedGameObject = null) Debug.Log("[InputService] No Selectables found"); } + private static Selectable[] GetAllSelectables() + { + Selectable[] allSelectables = Array.Empty(); + int allCount = Selectable.allSelectableCount; + if (allCount > 0) + allSelectables = new Selectable[allCount]; + else + return allSelectables; + + int count = Selectable.AllSelectablesNoAlloc(allSelectables); + if (count > 0) return allSelectables; + + allSelectables = Selectable.allSelectablesArray; + return allSelectables; + } + public GameObject GetSelectedGameObject() { return EventSystem.current.currentSelectedGameObject; @@ -218,7 +242,7 @@ public string GetBindingDisplayString(string scheme, string actionName, string p { // 既定の英語表示・デバイスレイアウト・controlPath を取得し、family 別ローカライズ名へ変換(未登録は英語へフォールバック) var raw = action.GetBindingDisplayString(index, out var deviceLayoutName, out var controlPath); - parts.Add(InputControlsLocalizer.Localize(deviceLayoutName, controlPath, raw)); + parts.Add(_localizationService.GetStringByInputControls(deviceLayoutName, controlPath, raw)); } return string.Join("/", parts); } From d2825f20a070e8fff6dd514259e084a5298b1f96 Mon Sep 17 00:00:00 2001 From: "Rei.K" Date: Sun, 12 Jul 2026 16:45:20 +0900 Subject: [PATCH 4/9] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=83=98=E3=83=AB?= =?UTF-8?q?=E3=83=91=E3=83=BC=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runtime/Shared/Input/InputSystemHelper.cs | 24 ---------- .../Shared/Input/InputSystemHelper.cs.meta | 3 -- .../Localization/ContextActionsLocalizer.cs | 10 ----- .../ContextActionsLocalizer.cs.meta | 3 -- .../Localization/InputControlsLocalizer.cs | 45 ------------------- .../InputControlsLocalizer.cs.meta | 2 - .../InteractionMessagesLocalizer.cs | 10 ----- .../InteractionMessagesLocalizer.cs.meta | 3 -- .../Localization/InteractionsLocalizer.cs | 10 ----- .../InteractionsLocalizer.cs.meta | 2 - .../Shared/Localization/LocalizationHelper.cs | 13 ------ .../Localization/LocalizationHelper.cs.meta | 3 -- 12 files changed, 128 deletions(-) delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Input/InputSystemHelper.cs delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Input/InputSystemHelper.cs.meta delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Localization/ContextActionsLocalizer.cs delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Localization/ContextActionsLocalizer.cs.meta delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InputControlsLocalizer.cs delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InputControlsLocalizer.cs.meta delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionMessagesLocalizer.cs delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionMessagesLocalizer.cs.meta delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionsLocalizer.cs delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionsLocalizer.cs.meta delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizationHelper.cs delete mode 100644 src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizationHelper.cs.meta diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Input/InputSystemHelper.cs b/src/Game.Client/Assets/Programs/Runtime/Shared/Input/InputSystemHelper.cs deleted file mode 100644 index f5d8e867..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Input/InputSystemHelper.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using UnityEngine.UI; - -namespace Game.Shared.Input -{ - public static class InputSystemHelper - { - public static Selectable[] GetAllSelectables() - { - Selectable[] allSelectables = Array.Empty(); - int allCount = Selectable.allSelectableCount; - if (allCount > 0) - allSelectables = new Selectable[allCount]; - else - return allSelectables; - - int count = Selectable.AllSelectablesNoAlloc(allSelectables); - if (count > 0) return allSelectables; - - allSelectables = Selectable.allSelectablesArray; - return allSelectables; - } - } -} diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Input/InputSystemHelper.cs.meta b/src/Game.Client/Assets/Programs/Runtime/Shared/Input/InputSystemHelper.cs.meta deleted file mode 100644 index 47ae8a4f..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Input/InputSystemHelper.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 4318b2bacdb74eb7bf9b383889c56a89 -timeCreated: 1779548363 \ No newline at end of file diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/ContextActionsLocalizer.cs b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/ContextActionsLocalizer.cs deleted file mode 100644 index b95ce0eb..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/ContextActionsLocalizer.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Game.Shared.Constants; - -namespace Game.Shared.Localization -{ - public static class ContextActionsLocalizer - { - public static string Localize(string localizeKey) - => LocalizationHelper.GetLocalizedString(LocalizationConstants.ContextActionsTable , localizeKey); - } -} diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/ContextActionsLocalizer.cs.meta b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/ContextActionsLocalizer.cs.meta deleted file mode 100644 index e040f071..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/ContextActionsLocalizer.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 067b77b998b44b3f9b947e728dfe2288 -timeCreated: 1782405768 \ No newline at end of file diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InputControlsLocalizer.cs b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InputControlsLocalizer.cs deleted file mode 100644 index 5f725117..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InputControlsLocalizer.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Game.Shared.Constants; -using UnityEngine.InputSystem; - -namespace Game.Shared.Localization -{ - /// - /// 入力コントロールの表示名をローカライズする。 - /// controlPath("space", "buttonSouth", "dpad/up" 等、デバイス接頭辞なし)をキーに - /// StringTable "InputControls" を引き、未登録キーは Unity 既定の英語表示へフォールバックする。 - /// ゲームパッドは接続デバイスの family(xbox/ps/switch)でプレフィックス付きキーを優先的に引く。 - /// - public static class InputControlsLocalizer - { - /// - /// controlPath をキーに InputControls からローカライズ名を引く。 - /// family プレフィックス付きキー → 無印キー → fallback(raw) の順に解決する。 - /// - /// 解決済みコントロールのデバイスレイアウト名(family 判定用。null/空可)。 - /// - /// - public static string Localize(string deviceLayoutName, string controlPath, string fallback) - { - if (string.IsNullOrEmpty(controlPath)) return fallback; - - var prefix = ResolveFamilyPrefix(deviceLayoutName); - if (prefix.Length > 0) - { - var localized = LocalizationHelper.GetLocalizedString(LocalizationConstants.InputControlsTable, prefix + controlPath); - if (!string.IsNullOrEmpty(localized)) return localized; - } - - return LocalizationHelper.GetLocalizedString(LocalizationConstants.InputControlsTable, controlPath) ?? fallback; - } - - /// デバイスレイアウトを family プレフィックスへ分類する(未知/未接続は空=無印)。 - private static string ResolveFamilyPrefix(string deviceLayoutName) - { - if (string.IsNullOrEmpty(deviceLayoutName)) return string.Empty; - if (InputSystem.IsFirstLayoutBasedOnSecond(deviceLayoutName, "DualShockGamepad")) return "ps/"; - if (InputSystem.IsFirstLayoutBasedOnSecond(deviceLayoutName, "SwitchProControllerHID")) return "switch/"; - if (InputSystem.IsFirstLayoutBasedOnSecond(deviceLayoutName, "XInputController")) return "xbox/"; - return string.Empty; - } - } -} diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InputControlsLocalizer.cs.meta b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InputControlsLocalizer.cs.meta deleted file mode 100644 index 8d65c65d..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InputControlsLocalizer.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: d473c5fa06c90354db647a4416b6ef39 \ No newline at end of file diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionMessagesLocalizer.cs b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionMessagesLocalizer.cs deleted file mode 100644 index 298a9491..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionMessagesLocalizer.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Game.Shared.Constants; - -namespace Game.Shared.Localization -{ - public static class InteractionMessagesLocalizer - { - public static string Localize(string localizeKey) - => LocalizationHelper.GetLocalizedString(LocalizationConstants.InteractionMessagesTable , localizeKey); - } -} diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionMessagesLocalizer.cs.meta b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionMessagesLocalizer.cs.meta deleted file mode 100644 index c9499ba9..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionMessagesLocalizer.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 1f663bc4007c4bfb84d1aa4e02d93009 -timeCreated: 1782615025 \ No newline at end of file diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionsLocalizer.cs b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionsLocalizer.cs deleted file mode 100644 index 053ba98c..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionsLocalizer.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Game.Shared.Constants; - -namespace Game.Shared.Localization -{ - public static class InteractionsLocalizer - { - public static string Localize(string localizeKey) - => LocalizationHelper.GetLocalizedString(LocalizationConstants.InteractionsTable , localizeKey); - } -} diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionsLocalizer.cs.meta b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionsLocalizer.cs.meta deleted file mode 100644 index bf20e2d4..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/InteractionsLocalizer.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 5414b5e2773a7e947aca9c76bf831c2e \ No newline at end of file diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizationHelper.cs b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizationHelper.cs deleted file mode 100644 index 845e42d9..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizationHelper.cs +++ /dev/null @@ -1,13 +0,0 @@ -using UnityEngine.Localization.Settings; - -namespace Game.Shared.Localization -{ - public static class LocalizationHelper - { - public static string GetLocalizedString(string tableName, string localizeKey) - { - var entry = LocalizationSettings.StringDatabase.GetTableEntry(tableName, localizeKey).Entry; - return entry != null ? entry.GetLocalizedString() : null; - } - } -} diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizationHelper.cs.meta b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizationHelper.cs.meta deleted file mode 100644 index 97d94feb..00000000 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizationHelper.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 0b9d02fcbdf84f5386bf473f2af555e3 -timeCreated: 1782405235 \ No newline at end of file From d04057add3154072ecc0121dde7d7a69c8454559 Mon Sep 17 00:00:00 2001 From: "Rei.K" Date: Sun, 12 Jul 2026 16:45:30 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=E5=AE=9F=E8=A3=85=E5=85=88=E3=81=AE?= =?UTF-8?q?=E5=B7=AE=E3=81=97=E6=9B=BF=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MVC/Horror/Dialogs/HorrorOptionDialog.cs | 7 +++++-- .../Horror/Dialogs/HorrorSaveDataDialogComponent.cs | 4 +++- .../MVC/Horror/Interaction/InteractableBase.cs | 5 ++++- .../MVC/Horror/Interaction/InteractionPromptView.cs | 13 ++++++++----- .../Inventory/HorrorInventoryContextActionView.cs | 7 ++++++- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialog.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialog.cs index 30ea79e4..031101de 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialog.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialog.cs @@ -11,6 +11,7 @@ using Game.Shared.Input; using Game.Shared.Localization; using Game.Shared.Services; +using Game.Shared.Services.Interfaces; using R3; using UnityEngine; @@ -22,6 +23,7 @@ public class HorrorOptionDialog : GameDialogScene(); _audioService = GameServiceManager.Resolve(); + _localizationService = GameServiceManager.Resolve(); _optionSaveRepository = GameServiceManager.Resolve(); _optionService = GameServiceManager.Resolve(); return base.PreInitialize(); @@ -240,10 +243,10 @@ public override UniTask Startup() .AddTo(Disposables); // ロケール変更でバインド表示名を再ローカライズ - LocalizationEvents.OnLocaleChanged.Subscribe(_ => RefreshBindingDisplays()).AddTo(Disposables); + _localizationService.OnLocaleChanged.Subscribe(_ => RefreshBindingDisplays()).AddTo(Disposables); // コントローラー接続/切替に追従して family 別表示を更新する - InputSystemEvents.OnDeviceChanged.Subscribe(_ => RefreshBindingDisplays()).AddTo(Disposables); + _inputService.OnDeviceChanged.Subscribe(_ => RefreshBindingDisplays()).AddTo(Disposables); return base.Startup(); } diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorSaveDataDialogComponent.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorSaveDataDialogComponent.cs index 1ab1217f..e00fa58d 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorSaveDataDialogComponent.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorSaveDataDialogComponent.cs @@ -5,6 +5,7 @@ using Game.MVC.Core.Scenes; using Game.Shared.Localization; using Game.Shared.Services; +using Game.Shared.Services.Interfaces; using R3; using UnityEngine; @@ -27,6 +28,7 @@ public Observable OnSlotSelected public void SetSlotInfos(IReadOnlyList slots) { var database = GameServiceManager.Resolve().Database; + var localization = GameServiceManager.Resolve(); foreach (var slot in slots) { @@ -42,7 +44,7 @@ public void SetSlotInfos(IReadOnlyList slots) if (slot.HasData) { if (database.HorrorInteractionMasterTable.TryFindById(slot.SavepointId, out var master)) - savepointName = InteractionsLocalizer.Localize(master.InteractionLocalizeKey); + savepointName = localization.GetStringByInteractions(master.InteractionLocalizeKey); else Debug.LogError($"[{GetType().Name}] HorrorInteractionMaster not found: SavepointId={slot.SavepointId}"); diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractableBase.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractableBase.cs index 27e6756b..93c60218 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractableBase.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractableBase.cs @@ -7,6 +7,7 @@ using Game.Shared.Scriptable.Database; using Game.Shared.Scriptable.Database.Tables; using Game.Shared.Services; +using Game.Shared.Services.Interfaces; using UnityEngine; namespace Game.Horror.Interaction @@ -36,6 +37,7 @@ public abstract class InteractableBase : MonoBehaviour, IInteractable protected IHorrorInteractionService InteractionService { get; private set; } protected IHorrorInventoryService InventoryService { get; private set; } + private ILocalizationService _localizationService; private IScriptableDatabaseService _databaseService; protected ScriptableDatabase Database => _databaseService.Database; @@ -54,6 +56,7 @@ protected virtual void Start() InteractionService = GameServiceManager.Resolve(); InventoryService = GameServiceManager.Resolve(); + _localizationService = GameServiceManager.Resolve(); _databaseService = GameServiceManager.Resolve(); if (_databaseService.Database.HorrorInteractionMasterTable.TryFindById(_interactionId, out var master)) { @@ -132,7 +135,7 @@ public UniTask TryShowRejectionMessage() if (Master == null || string.IsNullOrEmpty(Master.RejectionMessageLocalizeKey)) return UniTask.FromResult(false); - var message = InteractionMessagesLocalizer.Localize(Master.RejectionMessageLocalizeKey); + var message = _localizationService.GetStringByInteractionMessages(Master.RejectionMessageLocalizeKey); return HorrorMessageDialog.RunAsync(message); } diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractionPromptView.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractionPromptView.cs index 5be15b65..4e935506 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractionPromptView.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractionPromptView.cs @@ -3,6 +3,7 @@ using Game.Shared.Input; using Game.Shared.Localization; using Game.Shared.Scriptable.Database.Tables; +using Game.Shared.Services.Interfaces; using R3; using TMPro; using UnityEngine; @@ -44,6 +45,7 @@ public class InteractionPromptView : MonoBehaviour private HorrorInteractionMaster _master; private IInputSystemService _inputService; + private ILocalizationService _localizationService; private Camera _viewCamera; private bool _interactionToggle; @@ -53,14 +55,15 @@ public void Initialize(HorrorInteractionMaster master) _master = master; _inputService = GameServiceManager.Resolve(); - LocalizationEvents.OnLocaleChanged.Subscribe(_ => SetInteractionText()).AddTo(this); + _localizationService.OnLocaleChanged.Subscribe(_ => SetInteractionText()).AddTo(this); SetInteractionText(); _inputService.OnControlSchemeChanged.Subscribe(_ => SetInputBindingText()).AddTo(this); + _inputService.OnDeviceChanged.Subscribe(_ => SetInputBindingText()).AddTo(this); _inputService.OnBindingChanged .Where(x => x == _inputService.Player.Interact) - .Subscribe(_ => SetInputBindingText()).AddTo(this); - InputSystemEvents.OnDeviceChanged.Subscribe(_ => SetInputBindingText()).AddTo(this); + .Subscribe(_ => SetInputBindingText()) + .AddTo(this); SetInputBindingText(); _inputTypeRoot.SetActive(master.InputType == InteractionInputType.Hold); @@ -71,8 +74,8 @@ public void Initialize(HorrorInteractionMaster master) private void SetInteractionText() { _interactionText.text = !_interactionToggle - ? ContextActionsLocalizer.Localize(_master.InteractionVerbLocalizeKey) - : ContextActionsLocalizer.Localize(_master.ReinteractionVerbLocalizeKey); + ? _localizationService.GetStringByContextActions(_master.InteractionVerbLocalizeKey) + : _localizationService.GetStringByContextActions(_master.ReinteractionVerbLocalizeKey); } private void SetInputBindingText() diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Inventory/HorrorInventoryContextActionView.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Inventory/HorrorInventoryContextActionView.cs index 88ec0519..e26ef07b 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Inventory/HorrorInventoryContextActionView.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Inventory/HorrorInventoryContextActionView.cs @@ -1,5 +1,7 @@ +using Game.Core.Services; using Game.Shared.Enums; using Game.Shared.Localization; +using Game.Shared.Services.Interfaces; using R3; using TMPro; using UnityEngine; @@ -24,7 +26,10 @@ public class HorrorInventoryContextActionView : MonoBehaviour public void Initialize(InventoryContextActionType contextAction) { if (_label != null) - _label.text = ContextActionsLocalizer.Localize(contextAction.ToString()); + { + var localization = GameServiceManager.Resolve(); + _label.text = localization.GetStringByContextActions(contextAction.ToString()); + } _button.OnClickAsObservable() .Subscribe(_ => _onClicked.OnNext(contextAction)) From 599e8174c467900bb0dc88bd79d24178e82ba023 Mon Sep 17 00:00:00 2001 From: "Rei.K" Date: Sun, 12 Jul 2026 17:19:25 +0900 Subject: [PATCH 6/9] resolve: ILocalizationService --- .../Runtime/MVC/Horror/Interaction/InteractionPromptView.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractionPromptView.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractionPromptView.cs index 4e935506..7e3aba33 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractionPromptView.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Interaction/InteractionPromptView.cs @@ -1,7 +1,5 @@ using Game.Core.Services; using Game.Shared.Enums; -using Game.Shared.Input; -using Game.Shared.Localization; using Game.Shared.Scriptable.Database.Tables; using Game.Shared.Services.Interfaces; using R3; @@ -54,6 +52,7 @@ public void Initialize(HorrorInteractionMaster master) { _master = master; _inputService = GameServiceManager.Resolve(); + _localizationService = GameServiceManager.Resolve(); _localizationService.OnLocaleChanged.Subscribe(_ => SetInteractionText()).AddTo(this); SetInteractionText(); From 2c4fac7539ca927007c78d31d4b415aabdcb577e Mon Sep 17 00:00:00 2001 From: "Rei.K" Date: Sun, 12 Jul 2026 17:19:53 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=E5=BE=AE=E3=83=AA=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=AF=E3=82=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Programs/Runtime/MVC/Core/UI/SliderIndexSelector.cs | 2 +- .../Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialog.cs | 3 --- .../MVC/Horror/Dialogs/HorrorSaveDataDialogComponent.cs | 1 - .../Programs/Runtime/Shared/Localization/LocalizeStrings.cs | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/SliderIndexSelector.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/SliderIndexSelector.cs index 65d31ecf..dc869926 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/SliderIndexSelector.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/SliderIndexSelector.cs @@ -18,7 +18,7 @@ public class SliderIndexSelector : MonoBehaviour private bool _initialized; private readonly Subject _onValueChanged = new(); - public Observable OnValueChanged => _onValueChanged.AsObservable(); + public Observable OnValueChanged => _onValueChanged; /// 選択中の index。 public int Index => Mathf.RoundToInt(_slider.value); diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialog.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialog.cs index 031101de..1b0e1861 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialog.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialog.cs @@ -2,14 +2,11 @@ using Cysharp.Threading.Tasks; using Game.Core.Services; using Game.Horror.SaveData; -using Game.Horror.Services; using Game.Horror.Services.Interfaces; using Game.MVC.Core.Enums; using Game.MVC.Core.Scenes; using Game.Shared.Constants; using Game.Shared.Extensions; -using Game.Shared.Input; -using Game.Shared.Localization; using Game.Shared.Services; using Game.Shared.Services.Interfaces; using R3; diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorSaveDataDialogComponent.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorSaveDataDialogComponent.cs index e00fa58d..27cd681c 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorSaveDataDialogComponent.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorSaveDataDialogComponent.cs @@ -3,7 +3,6 @@ using Game.Core.Services; using Game.Horror.SaveData; using Game.MVC.Core.Scenes; -using Game.Shared.Localization; using Game.Shared.Services; using Game.Shared.Services.Interfaces; using R3; diff --git a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizeStrings.cs b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizeStrings.cs index 112db464..ed33db59 100644 --- a/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizeStrings.cs +++ b/src/Game.Client/Assets/Programs/Runtime/Shared/Localization/LocalizeStrings.cs @@ -12,7 +12,7 @@ public class LocalizeStrings : MonoBehaviour private string[] _strings; private readonly Subject _onChangedLocale = new(); - public Observable OnChangedLocale => _onChangedLocale.AsObservable(); + public Observable OnChangedLocale => _onChangedLocale; private void Awake() { From 2fc0cbec1cca7e2df422b3795a791438689d9102 Mon Sep 17 00:00:00 2001 From: "Rei.K" Date: Sun, 12 Jul 2026 17:25:10 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Services/Abstractions/IInputSystemService.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/Abstractions/IInputSystemService.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/Abstractions/IInputSystemService.cs index 5c838dcf..3d3b2f08 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/Abstractions/IInputSystemService.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/Services/Abstractions/IInputSystemService.cs @@ -28,10 +28,19 @@ public interface IInputSystemService : IGameService /// InputActionAsset InputActionAsset { get; } + /// + /// 操作スキーマ変更イベント + /// Observable OnControlSchemeChanged { get; } + /// + /// 操作デバイス切替イベント + /// Observable<(InputDevice device, InputDeviceChange deviceChange)> OnDeviceChanged { get; } + /// + /// キーバインド変更イベント + /// Observable OnBindingChanged { get; } /// From 5cd41a29b2fbef75bcb5d4cb112a4b9d8c3d19bc Mon Sep 17 00:00:00 2001 From: "Rei.K" Date: Sun, 12 Jul 2026 17:40:48 +0900 Subject: [PATCH 9/9] rename: InputActionRebindingView --- .../{InputActionRebindView.cs => InputActionRebindingView.cs} | 2 +- ...ionRebindView.cs.meta => InputActionRebindingView.cs.meta} | 0 .../Runtime/MVC/Horror/Dialogs/HorrorOptionDialogComponent.cs | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/{InputActionRebindView.cs => InputActionRebindingView.cs} (98%) rename src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/{InputActionRebindView.cs.meta => InputActionRebindingView.cs.meta} (100%) diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/InputActionRebindView.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/InputActionRebindingView.cs similarity index 98% rename from src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/InputActionRebindView.cs rename to src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/InputActionRebindingView.cs index 33a2ace5..158eeea8 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/InputActionRebindView.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/InputActionRebindingView.cs @@ -10,7 +10,7 @@ namespace Game.Core.UI /// 現在のバインド表示と「変更」ボタンを持ち、押下を Observable で通知する。 /// リバインド実行・重複判定などの入力ロジックは持たず、表示更新のみを担う。 /// - public class InputActionRebindView : MonoBehaviour + public class InputActionRebindingView : MonoBehaviour { [Header("Identity")] [SerializeField] private string _scheme; // コントロールスキーム(Keyboard&Mouse / Gamepad) diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/InputActionRebindView.cs.meta b/src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/InputActionRebindingView.cs.meta similarity index 100% rename from src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/InputActionRebindView.cs.meta rename to src/Game.Client/Assets/Programs/Runtime/MVC/Core/UI/InputActionRebindingView.cs.meta diff --git a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialogComponent.cs b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialogComponent.cs index a57aed9c..6d719539 100644 --- a/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialogComponent.cs +++ b/src/Game.Client/Assets/Programs/Runtime/MVC/Horror/Dialogs/HorrorOptionDialogComponent.cs @@ -33,7 +33,7 @@ public class HorrorOptionDialogComponent : GameSceneComponent [SerializeField] private SliderBooleanSelector _crouchMode; [Header("Options - Control")] - [SerializeField] private InputActionRebindView[] _rebindViews; + [SerializeField] private InputActionRebindingView[] _rebindViews; [SerializeField] private Button _resetKeyboardBindingsButton; [SerializeField] private Button _resetGamepadBindingsButton; @@ -85,7 +85,7 @@ public class HorrorOptionDialogComponent : GameSceneComponent #region Controls /// キーリバインド行(アクション×スキーム単位)。Dialog 側が購読・表示更新する。 - public IReadOnlyList RebindViews => _rebindViews; + public IReadOnlyList RebindViews => _rebindViews; /// スキーム別リセットボタン押下。値は対象スキーム(KBM / Gamepad)。 public Observable OnResetSchemeBindingsRequested => Observable.Merge(