현지화 로직 수정 및 관련 에셋 변경

This commit is contained in:
NTG 2025-09-01 20:32:31 +09:00
parent f175296ddb
commit f4c59ac2ee
16 changed files with 230 additions and 124 deletions

View File

@ -125,17 +125,6 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
--- !u!114 &346507494262572520 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 48813585706763955, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 315921613001048923}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &5874059589008679693 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6189840460486090838, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
@ -426,7 +415,6 @@ MonoBehaviour:
_enableBlockImage: 0
_filledImage: {fileID: 1182510989530764005}
_textLabel: {fileID: 5874059589008679693}
_textLabelLocalizeStringEvent: {fileID: 346507494262572520}
_canInteractTextColor: {r: 1, g: 1, b: 1, a: 1}
_cannotInteractTextColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
--- !u!224 &1946676491649190586 stripped
@ -541,7 +529,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7995964240802183498, guid: c40aab0ea6318ea49a4aecbc0218e971, type: 3}
propertyPath: m_SizeDelta.x
value: 140
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7995964240802183498, guid: c40aab0ea6318ea49a4aecbc0218e971, type: 3}
propertyPath: m_SizeDelta.y

View File

@ -538,7 +538,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7857853769095069531, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
propertyPath: m_Name
value: TextLabel
value: MessageLabel
objectReference: {fileID: 0}
- target: {fileID: 9048682655274794071, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
propertyPath: m_Pivot.x
@ -630,15 +630,15 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 9048682655274794071, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 7306972725390776686}
m_PrefabAsset: {fileID: 0}
--- !u!114 &7334955628972040157 stripped
--- !u!114 &3495127426411772216 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 48813585706763955, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_CorrespondingSourceObject: {fileID: 6189840460486090838, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 7306972725390776686}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3}
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &7874331150097499879
@ -814,7 +814,7 @@ MonoBehaviour:
<UiType>k__BackingField: 3
_enableBlockImage: 1
_uiActionsInputBinding: {fileID: 11400000, guid: 99d3d87bd43df65488e757c43a308f36, type: 2}
_messageLabelLocalizeStringEvent: {fileID: 7334955628972040157}
_messageText: {fileID: 3495127426411772216}
_cancelButton: {fileID: 3767486664176736975}
_confirmButton: {fileID: 8554221910551001898}
--- !u!114 &4851084330822594573

View File

@ -1371,9 +1371,9 @@ MonoBehaviour:
- {fileID: 8179731659266011177}
- {fileID: 943752979832358475}
- {fileID: 7347161784464666498}
_cookwareName: {fileID: 8346850494700711263}
_cookName: {fileID: 8922944878275408075}
_cookDescriptionName: {fileID: 5409559328787730612}
_cookwareName: {fileID: 2782706584750590906}
_cookName: {fileID: 3359539908789261870}
_cookDescriptionName: {fileID: 2186863913026844241}
_cookPrice: {fileID: 2138212829984677371}
_tasteHashTagContent1: {fileID: 208636364792142702}
_tasteHashTagContentLayoutGroup: {fileID: 1834629153598744461}
@ -4088,22 +4088,22 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
--- !u!224 &3903660797849283152 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 9048682655274794071, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 5458352023630566919}
m_PrefabAsset: {fileID: 0}
--- !u!114 &5409559328787730612 stripped
--- !u!114 &2186863913026844241 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 48813585706763955, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_CorrespondingSourceObject: {fileID: 6189840460486090838, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 5458352023630566919}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3}
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &3903660797849283152 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 9048682655274794071, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 5458352023630566919}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &5542051466831491153
PrefabInstance:
m_ObjectHideFlags: 0
@ -5751,15 +5751,15 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 9048682655274794071, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 8320563038175243244}
m_PrefabAsset: {fileID: 0}
--- !u!114 &8346850494700711263 stripped
--- !u!114 &2782706584750590906 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 48813585706763955, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_CorrespondingSourceObject: {fileID: 6189840460486090838, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 8320563038175243244}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3}
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &8336548643911891367
@ -6359,15 +6359,15 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 9048682655274794071, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 8897354357502965368}
m_PrefabAsset: {fileID: 0}
--- !u!114 &8922944878275408075 stripped
--- !u!114 &3359539908789261870 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 48813585706763955, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_CorrespondingSourceObject: {fileID: 6189840460486090838, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 8897354357502965368}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3}
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &9050526275966405463

View File

@ -53,8 +53,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_viewImage: {fileID: 5168542205125039251}
_nameLocalizeStringEvent: {fileID: 8756294767538431005}
_descriptionLocalizeStringEvent: {fileID: 7808277355010082239}
_name: {fileID: 3228882035781370616}
_description: {fileID: 4113829672213848922}
_cookWarePanel: {fileID: 4302691437602401827}
_cookwareImage: {fileID: 3915032697630876799}
_tasteHashTagPanel: {fileID: 5646014643746221419}
@ -9176,11 +9176,11 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 2603685703181773184, guid: 3042958ab9668ed4aa25e965fc39b7f9, type: 3}
propertyPath: m_AnchorMax.x
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2603685703181773184, guid: 3042958ab9668ed4aa25e965fc39b7f9, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2603685703181773184, guid: 3042958ab9668ed4aa25e965fc39b7f9, type: 3}
propertyPath: m_AnchorMin.y
@ -9282,6 +9282,10 @@ PrefabInstance:
propertyPath: m_ConstrainProportionsScale
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3674250138247648768, guid: 3042958ab9668ed4aa25e965fc39b7f9, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4055127153857618644, guid: 3042958ab9668ed4aa25e965fc39b7f9, type: 3}
propertyPath: m_Sprite
value:
@ -9574,15 +9578,15 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 9048682655274794071, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 7850329751525360396}
m_PrefabAsset: {fileID: 0}
--- !u!114 &7808277355010082239 stripped
--- !u!114 &4113829672213848922 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 48813585706763955, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_CorrespondingSourceObject: {fileID: 6189840460486090838, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 7850329751525360396}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3}
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &7919876065651126185
@ -10819,15 +10823,15 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 9048682655274794071, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 8730773236163191470}
m_PrefabAsset: {fileID: 0}
--- !u!114 &8756294767538431005 stripped
--- !u!114 &3228882035781370616 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 48813585706763955, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_CorrespondingSourceObject: {fileID: 6189840460486090838, guid: c7ae409f7430c9a408d36ccf54ef4164, type: 3}
m_PrefabInstance: {fileID: 8730773236163191470}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3}
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &8803310511934872046

View File

@ -707,6 +707,30 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4021842251402093450, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4021842251402093450, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4021842251402093450, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_SizeDelta.x
value: 45.14
objectReference: {fileID: 0}
- target: {fileID: 4021842251402093450, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_SizeDelta.y
value: 49
objectReference: {fileID: 0}
- target: {fileID: 4021842251402093450, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchoredPosition.x
value: 22.57
objectReference: {fileID: 0}
- target: {fileID: 4021842251402093450, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchoredPosition.y
value: -24.5
objectReference: {fileID: 0}
- target: {fileID: 4130017465905115418, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMax.y
value: 1
@ -771,6 +795,30 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5322021587743099018, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5322021587743099018, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5322021587743099018, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5322021587743099018, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5322021587743099018, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5322021587743099018, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5331144586457227893, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMax.y
value: 0
@ -923,6 +971,30 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6729916646266324195, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6729916646266324195, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6729916646266324195, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6729916646266324195, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6729916646266324195, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6729916646266324195, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6783010733222258758, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMax.y
value: 1
@ -965,12 +1037,32 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6892356896533285718, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchoredPosition.x
value: 237.315
value: 440.17502
objectReference: {fileID: 0}
- target: {fileID: 6892356896533285718, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchoredPosition.y
value: -6.5
objectReference: {fileID: 0}
- target: {fileID: 7317153595074350300, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7317153595074350300, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7317153595074350300, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_SizeDelta.x
value: 172.86
objectReference: {fileID: 0}
- target: {fileID: 7317153595074350300, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchoredPosition.x
value: 232.78
objectReference: {fileID: 0}
- target: {fileID: 7317153595074350300, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_AnchoredPosition.y
value: -6.5
objectReference: {fileID: 0}
- target: {fileID: 7330412726684592059, guid: b995fff30cf814848a9d50fa0cb083a4, type: 3}
propertyPath: m_SizeDelta.x
value: 0

View File

@ -68,7 +68,7 @@ public void PostInit()
/// <summary>
/// 현재 선택된 로케일 기준으로 로컬라이징 텍스트를 가져옵니다.
/// </summary>
public LocalizedString GetLocalizedString(string key)
private LocalizedString GetLocalizedString(string key)
{
if (string.IsNullOrWhiteSpace(key)) return null;
@ -83,9 +83,6 @@ public LocalizedString GetLocalizedString(string key)
Debug.LogError($"[LocalizationManager] {key}값이 존재하지 않습니다.");
return null;
}
public LocalizedString GetLocalizedName(string key) => GetLocalizedString(key + Name);
public LocalizedString GetLocalizedDescription(string key) => GetLocalizedString(key + Description);
/// <summary>
/// 현재 로케일 기준 동기 문자열 반환 (스마트 문자열 인자 지원)

View File

@ -14,6 +14,7 @@ public enum SmartVariablesDomain : uint
RestaurantToday = 1u << 0,
ChecklistTargets = 1u << 1,
PlayerLevel = 1u << 2,
CarriableItem = 1u << 3,
All = 0xFFFFFFFFu,
}
@ -27,21 +28,24 @@ public enum SmartStringKey
ChecklistFoodCount,
ChecklistCookwareCount,
ChecklistMatchedMenuWithCookwareCount,
CarriableItemName
}
public class SmartStringVariables : Singleton<SmartStringVariables>, IManager, IEventHandler<SmartVariablesDirtyEvent>
public class SmartStringVariables : Singleton<SmartStringVariables>, IManager,
IEventHandler<SmartVariablesDirtyEvent>
{
private Dictionary<SmartStringKey, string> _smartStringKeys = new()
{
{SmartStringKey.Day, "day"},
{SmartStringKey.AddedTodayFoodCount, "addedTodayFoodCount"},
{SmartStringKey.AddedTodayCookwareCount, "addedTodayCookwareCount"},
{SmartStringKey.MatchedTodayMenuWithCookwareCount, "matchedTodayMenuWithCookwareCount"},
{SmartStringKey.ChecklistFoodCount, "checklistFoodCount"},
{SmartStringKey.ChecklistCookwareCount, "checklistCookwareCount"},
{SmartStringKey.ChecklistMatchedMenuWithCookwareCount, "checklistMatchedMenuWithCookwareCount"},
{ SmartStringKey.Day, "day" },
{ SmartStringKey.AddedTodayFoodCount, "addedTodayFoodCount" },
{ SmartStringKey.AddedTodayCookwareCount, "addedTodayCookwareCount" },
{ SmartStringKey.MatchedTodayMenuWithCookwareCount, "matchedTodayMenuWithCookwareCount" },
{ SmartStringKey.ChecklistFoodCount, "checklistFoodCount" },
{ SmartStringKey.ChecklistCookwareCount, "checklistCookwareCount" },
{ SmartStringKey.ChecklistMatchedMenuWithCookwareCount, "checklistMatchedMenuWithCookwareCount" },
{ SmartStringKey.CarriableItemName, "carriableItemName" }
};
private GameLevelState GetGameLevelState() => GameState.Instance.LevelState;
private RestaurantManagementData GetRestaurantManagementData() => RestaurantData.Instance.ManagementData;
private RestaurantManagementState GetRestaurantManagementState() => RestaurantState.Instance.ManagementState;
@ -51,7 +55,9 @@ private void OnDestroy()
EventBus.Unregister<SmartVariablesDirtyEvent>(this);
}
public void PreInit() { }
public void PreInit()
{
}
public async Task Init()
{
@ -62,6 +68,7 @@ public async Task Init()
Set(_smartStringKeys[SmartStringKey.AddedTodayFoodCount], GetRestaurantManagementState().AddedTodayFoodCount);
Set(_smartStringKeys[SmartStringKey.AddedTodayCookwareCount], GetRestaurantManagementState().AddedTodayCookwareCount);
Set(_smartStringKeys[SmartStringKey.MatchedTodayMenuWithCookwareCount], GetRestaurantManagementState().MatchedTodayMenuWithCookwareCount);
Set(_smartStringKeys[SmartStringKey.CarriableItemName], string.Empty);
await Task.CompletedTask;
}
@ -80,72 +87,89 @@ public void HandleEvent(SmartVariablesDirtyEvent evt)
RefreshAll();
return;
}
if ((flags & SmartVariablesDomain.RestaurantToday) != 0)
if (flags.HasFlag(SmartVariablesDomain.RestaurantToday))
{
RefreshTodayMenuCounts();
}
if ((flags & SmartVariablesDomain.ChecklistTargets) != 0)
if (flags.HasFlag(SmartVariablesDomain.ChecklistTargets))
{
RefreshChecklistTargets();
}
if ((flags & SmartVariablesDomain.PlayerLevel) != 0)
if (flags.HasFlag(SmartVariablesDomain.PlayerLevel))
{
RefreshDay();
}
if (flags.HasFlag(SmartVariablesDomain.CarriableItem))
{
RefreshCarriableItem();
}
}
private void RefreshAll()
{
RefreshDay();
RefreshTodayMenuCounts();
RefreshChecklistTargets();
RefreshCarriableItem();
}
public void RefreshTodayMenuCounts()
private void RefreshTodayMenuCounts()
{
Set(_smartStringKeys[SmartStringKey.AddedTodayFoodCount], GetRestaurantManagementState().AddedTodayFoodCount);
Set(_smartStringKeys[SmartStringKey.AddedTodayCookwareCount], GetRestaurantManagementState().AddedTodayCookwareCount);
Set(_smartStringKeys[SmartStringKey.MatchedTodayMenuWithCookwareCount], GetRestaurantManagementState().MatchedTodayMenuWithCookwareCount);
}
public void RefreshChecklistTargets()
private void RefreshChecklistTargets()
{
Set(_smartStringKeys[SmartStringKey.ChecklistFoodCount], GetRestaurantManagementData().ChecklistFoodCount);
Set(_smartStringKeys[SmartStringKey.ChecklistCookwareCount], GetRestaurantManagementData().ChecklistCookwareCount);
Set(_smartStringKeys[SmartStringKey.ChecklistMatchedMenuWithCookwareCount], GetRestaurantManagementData().ChecklistMatchedMenuWithCookwareCount);
}
public void RefreshDay()
private void RefreshDay()
{
var gameLevelStateSo = GameState.Instance.LevelState;
Set(_smartStringKeys[SmartStringKey.Day], gameLevelStateSo.Level);
}
public void RefreshAll()
private void RefreshCarriableItem()
{
RefreshDay();
RefreshTodayMenuCounts();
RefreshChecklistTargets();
var player = PlayerManager.Instance.GetPlayer();
var carrier = player?.GetComponent<ICarrier>();
var carriableId = carrier?.GetCurrentCarriableId() ?? string.Empty;
var carriableItemName = string.IsNullOrEmpty(carriableId)
? string.Empty
: LocalizationManager.Instance.GetName(carriableId);
Set(_smartStringKeys[SmartStringKey.CarriableItemName], carriableItemName);
}
// ---------- 공용 Set API (가비지 최소화) ----------
/// <summary>int 변수 세팅. {key} 로 접근.</summary>
public void Set(string key, int value)
private void Set(string key, int value)
{
var v = Ensure<IntVariable>(key);
if (v.Value != value) v.Value = value;
}
/// <summary>float 변수 세팅. {key} 로 접근.</summary>
public void Set(string key, float value)
private void Set(string key, float value)
{
var v = Ensure<FloatVariable>(key);
if (Mathf.Approximately(v.Value, value) == false) v.Value = value;
}
/// <summary>bool 변수 세팅. {key} 로 접근.</summary>
public void Set(string key, bool value)
private void Set(string key, bool value)
{
var v = Ensure<BoolVariable>(key);
if (v.Value != value) v.Value = value;
}
/// <summary>string 변수 세팅. {key} 로 접근.</summary>
public void Set(string key, string value)
private void Set(string key, string value)
{
var v = Ensure<StringVariable>(key);
if (string.Equals(v.Value, value) == false) v.Value = value;
@ -155,7 +179,7 @@ public void Set(string key, string value)
/// enum은 보통 현지화 포맷에서 문자열로 취급하는 편이 직관적입니다.
/// 필요시 IntVariable로 바꾸고 (int)(object)value 저장하는 버전도 추가 가능.
/// </summary>
public void SetEnum<TEnum>(string key, TEnum value) where TEnum : struct
private void SetEnum<TEnum>(string key, TEnum value) where TEnum : struct
{
var v = Ensure<StringVariable>(key);
string s = value.ToString();
@ -190,4 +214,4 @@ public void SetEnum<TEnum>(string key, TEnum value) where TEnum : struct
return (T)created;
}
}
}
}

View File

@ -1,7 +1,5 @@
using TMPro;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.Localization.Components;
using UnityEngine.UI;
namespace DDD
@ -10,7 +8,6 @@ public class InteractionMessageUi : BaseUi, IEventHandler<ShowInteractionUiEvent
{
[SerializeField] private Image _filledImage;
[SerializeField] private TextMeshProUGUI _textLabel;
[SerializeField] private LocalizeStringEvent _textLabelLocalizeStringEvent;
[SerializeField] private Color _canInteractTextColor = Color.white;
[SerializeField] private Color _cannotInteractTextColor = Color.gray2;
@ -61,7 +58,7 @@ private void ShowInteractionUiEvent(ShowInteractionUiEvent evt)
if (_previousMessageKey != currentMessageKey)
{
_textLabelLocalizeStringEvent.StringReference = LocalizationManager.Instance.GetLocalizedString(currentMessageKey);
_textLabel.text = LocalizationManager.Instance.GetString(currentMessageKey);
_previousMessageKey = currentMessageKey;
}

View File

@ -1,3 +1,4 @@
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
@ -10,7 +11,7 @@ namespace DDD
[RequireComponent(typeof(ConfirmViewModel))]
public class ConfirmUi : PopupUi<RestaurantUiActions, ConfirmViewModel>
{
[SerializeField] private LocalizeStringEvent _messageLabelLocalizeStringEvent;
[SerializeField] private TextMeshProUGUI _messageText;
[SerializeField] private CommonButton _cancelButton;
[SerializeField] private CommonButton _confirmButton;
@ -21,9 +22,9 @@ protected override GameObject GetInitialSelected()
protected override void OnCreatedInitializePopup()
{
_messageLabelLocalizeStringEvent.OnUpdateString.Invoke(string.Empty);
_messageText.text = string.Empty;
BindingHelper.BindLocalizedStringEvent(_bindingContext, _messageLabelLocalizeStringEvent, nameof(_viewModel.MessageLocalizedString));
BindingHelper.BindText(_bindingContext, _messageText, nameof(_viewModel.Message));
BindingHelper.BindActive(_bindingContext, _cancelButton.gameObject, nameof(_viewModel.IsCancelButtonVisible));
_cancelButton.AddListener(() =>

View File

@ -1,19 +1,20 @@
using TMPro;
using UnityEngine.Events;
using UnityEngine.Localization;
namespace DDD
{
public class ConfirmViewModel : SimpleViewModel
{
private LocalizedString _messageLocalizedString;
private TextMeshProUGUI _messageText;
private string _message;
private bool _isCancelButtonVisible = true;
private UnityAction _onCancel;
private UnityAction _onConfirm;
public LocalizedString MessageLocalizedString
public string Message
{
get => _messageLocalizedString;
set => SetField(ref _messageLocalizedString, value);
get => _message;
set => SetField(ref _message, value);
}
public bool IsCancelButtonVisible
@ -35,7 +36,7 @@ public override void Cleanup()
public void SetupConfirm(string messageKey, UnityAction onConfirm, UnityAction onCancel, bool showCancelButton)
{
MessageLocalizedString = LocalizationManager.Instance.GetLocalizedString(messageKey);
Message = LocalizationManager.Instance.GetString(messageKey);
_onConfirm = onConfirm;
_onCancel = onCancel;
IsCancelButtonVisible = showCancelButton;

View File

@ -43,7 +43,7 @@ public GameObject GetCarrierGameObject()
public string GetCurrentCarriableId()
{
return _currentCarriable.GetId();
return _currentCarriable?.GetId() ?? string.Empty;
}
public ICarriable GetCurrentCarriable()
@ -72,13 +72,20 @@ public void Carry(ICarriable carriable)
_speechBubble ??= GetComponentInChildren<ISpeechBubble>();
_speechBubble?.Show(_currentCarriable.GetId());
var evt = GameEvents.SmartVariablesDirtyEvent;
evt.DomainFlags = SmartVariablesDomain.CarriableItem;
EventBus.Broadcast(evt);
}
public void Use(ICarriable carriable)
{
_currentCarriable = null;
_speechBubble?.Hide();
_speechBubble.Hide();
var evt = GameEvents.SmartVariablesDirtyEvent;
evt.DomainFlags = SmartVariablesDomain.CarriableItem;
EventBus.Broadcast(evt);
}
}
}

View File

@ -3,7 +3,6 @@
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
using UnityEngine.Localization.Components;
using UnityEngine.UI;
namespace DDD.Restaurant
@ -17,9 +16,9 @@ public class CookUi : PopupUi<RestaurantUiActions, CookViewModel>
[SerializeField] private Image _cookwareImage;
[SerializeField] private Image _cookImage;
[SerializeField] private List<SelectedIngredient> _selectedIngredients = new(6);
[SerializeField] private LocalizeStringEvent _cookwareName;
[SerializeField] private LocalizeStringEvent _cookName;
[SerializeField] private LocalizeStringEvent _cookDescriptionName;
[SerializeField] private TextMeshProUGUI _cookwareName;
[SerializeField] private TextMeshProUGUI _cookName;
[SerializeField] private TextMeshProUGUI _cookDescriptionName;
[SerializeField] private TextMeshProUGUI _cookPrice;
[SerializeField] private RectTransform _tasteHashTagContent1;
[SerializeField] private HorizontalLayoutGroup _tasteHashTagContentLayoutGroup;
@ -102,10 +101,10 @@ protected override void OnInputCanceledPopup(RestaurantUiActions actionEnum, Inp
private void SetupBindings()
{
BindingHelper.BindImage(_bindingContext, _cookwareImage, nameof(_viewModel.CookwareIcon));
BindingHelper.BindLocalizedStringEvent(_bindingContext, _cookwareName, nameof(_viewModel.CookwareName));
BindingHelper.BindText(_bindingContext, _cookwareName, nameof(_viewModel.CookwareName));
BindingHelper.BindLocalizedStringEvent<CookViewModel>(_bindingContext, _cookName, viewModel => viewModel.SelectedCookSnapshot.Name);
BindingHelper.BindLocalizedStringEvent<CookViewModel>(_bindingContext, _cookDescriptionName, viewModel => viewModel.SelectedCookSnapshot.Description);
BindingHelper.BindText<CookViewModel>(_bindingContext, _cookName, viewModel => viewModel.SelectedCookSnapshot.Name);
BindingHelper.BindText<CookViewModel>(_bindingContext, _cookDescriptionName, viewModel => viewModel.SelectedCookSnapshot.Description);
BindingHelper.BindText<CookViewModel>(_bindingContext, _cookPrice, viewModel => viewModel.SelectedCookSnapshot.CookPrice);
BindingHelper.BindImage<CookViewModel>(_bindingContext, _cookImage, viewModel => viewModel.SelectedCookSnapshot.CookIcon);
}

View File

@ -8,16 +8,16 @@ namespace DDD.Restaurant
{
public class SelectedCookSnapshot
{
public LocalizedString Name { get; }
public LocalizedString Description { get; }
public string Name { get; }
public string Description { get; }
public Sprite CookIcon { get; }
public string CookPrice { get; }
public IReadOnlyList<IngredientEntry> IngredientEntries { get; }
public IReadOnlyList<TasteDataEntry> Tastes { get; }
public Material TasteMaterial { get; }
public SelectedCookSnapshot(LocalizedString name,
LocalizedString description, Sprite cookIcon, string cookPrice, IReadOnlyList<IngredientEntry> ingredientEntries,
public SelectedCookSnapshot(string name,
string description, Sprite cookIcon, string cookPrice, IReadOnlyList<IngredientEntry> ingredientEntries,
IReadOnlyList<TasteDataEntry> tastes, Material tasteMaterial)
{
Name = name;
@ -51,8 +51,8 @@ public Sprite CookwareIcon
set => SetField(ref _cookwareIcon, value);
}
private LocalizedString _cookwareName;
public LocalizedString CookwareName
private string _cookwareName;
public string CookwareName
{
get => _cookwareName;
set => SetField(ref _cookwareName, value);
@ -102,7 +102,7 @@ public void SetCookwareType(CookwareType cookwareType)
var cookwareDatas = DataManager.Instance.GetDataAsset<CookwareDataAsset>().GetDataList();
var cookwareKey = cookwareDatas.Find(data => data.CookwareType == cookwareType).Id;
CookwareIcon = DataManager.Instance.GetIcon(cookwareKey);
CookwareName = LocalizationManager.Instance.GetLocalizedName(cookwareKey);
CookwareName = LocalizationManager.Instance.GetName(cookwareKey);
}
public void SetAddedCook(int index)
@ -236,8 +236,8 @@ private void UpdateSelectedCook()
{
var selectedItemModel = SelectedCookSlot.Model;
string key = selectedItemModel.GetRecipeResultKey;
var nameLocalizedString = LocalizationManager.Instance.GetLocalizedName(key);
var descriptionLocalizedString = LocalizationManager.Instance.GetLocalizedDescription(key);
var nameLocalizedString = LocalizationManager.Instance.GetName(key);
var descriptionLocalizedString = LocalizationManager.Instance.GetDescription(key);
var cookIcon = selectedItemModel.GetResultIcon;
var cookPrice = selectedItemModel.GetPrice.ToGold();
var ingredientEntries = selectedItemModel.GetIngredients;

View File

@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.Localization.Components;
using UnityEngine.UI;
namespace DDD.Restaurant
@ -14,8 +11,8 @@ public sealed class ItemDetailSnapshot
public bool ShowTastePanel { get; }
public bool ShowCookwarePanel { get; }
public Sprite CookwareSprite { get; }
public LocalizedString Name { get; }
public LocalizedString Description { get; }
public string Name { get; }
public string Description { get; }
public IReadOnlyList<TasteDataEntry> Tastes { get; }
public Material TasteMaterial { get; }
@ -24,8 +21,8 @@ public ItemDetailSnapshot(
bool showTastePanel,
bool showCookwarePanel,
Sprite cookwareSprite,
LocalizedString name,
LocalizedString description,
string name,
string description,
IReadOnlyList<TasteDataEntry> tastes,
Material tasteMaterial)
{
@ -53,8 +50,8 @@ public ItemDetailSnapshot(
public class ItemDetailView : MonoBehaviour, IUiView<RestaurantManagementViewModel>, IEventHandler<ItemSlotSelectedEvent>
{
[SerializeField] private Image _viewImage;
[SerializeField] private LocalizeStringEvent _nameLocalizeStringEvent;
[SerializeField] private LocalizeStringEvent _descriptionLocalizeStringEvent;
[SerializeField] private TextMeshProUGUI _name;
[SerializeField] private TextMeshProUGUI _description;
[SerializeField] private Transform _cookWarePanel;
[SerializeField] private Image _cookwareImage;
[SerializeField] private Transform _tasteHashTagPanel;
@ -74,8 +71,8 @@ public void Initialize(RestaurantManagementViewModel viewModel)
_viewModel = viewModel;
_cookwareImage.sprite = null;
_nameLocalizeStringEvent.OnUpdateString.Invoke(string.Empty);
_descriptionLocalizeStringEvent.OnUpdateString.Invoke(string.Empty);
_name.text = string.Empty;
_description.text = string.Empty;
EventBus.Register<ItemSlotSelectedEvent>(this);
}
@ -86,8 +83,8 @@ public void SetupBindings(BindingContext bindingContext)
BindingHelper.BindImage<RestaurantManagementViewModel>(bindingContext, _cookwareImage, viewModel => viewModel.ItemDetail.CookwareSprite);
BindingHelper.BindActive<RestaurantManagementViewModel>(bindingContext, _tasteHashTagPanel.gameObject, viewModel => viewModel.ItemDetail.ShowTastePanel);
BindingHelper.BindActive<RestaurantManagementViewModel>(bindingContext, _cookWarePanel.gameObject, viewModel => viewModel.ItemDetail.ShowCookwarePanel);
BindingHelper.BindLocalizedStringEvent<RestaurantManagementViewModel>(bindingContext, _nameLocalizeStringEvent, viewModel => viewModel.ItemDetail.Name);
BindingHelper.BindLocalizedStringEvent<RestaurantManagementViewModel>(bindingContext, _descriptionLocalizeStringEvent, viewModel => viewModel.ItemDetail.Description);
BindingHelper.BindText<RestaurantManagementViewModel>(bindingContext, _name, viewModel => viewModel.ItemDetail.Name);
BindingHelper.BindText<RestaurantManagementViewModel>(bindingContext, _description, viewModel => viewModel.ItemDetail.Description);
}
public void OnOpenedEvents()

View File

@ -407,8 +407,8 @@ private void RecomputeItemDetail()
bool showCookware = CurrentCategory is InventoryCategoryType.Food or InventoryCategoryType.Drink;
var cookwareSprite = SelectedItem.GetCookwareIcon;
string key = SelectedItem.ItemType == ItemType.Recipe ? SelectedItem.GetRecipeResultKey : SelectedItem.Id;
var nameLocalizedString = LocalizationManager.Instance.GetLocalizedName(key);
var descriptionLocalizedString = LocalizationManager.Instance.GetLocalizedDescription(key);
var nameLocalizedString = LocalizationManager.Instance.GetName(key);
var descriptionLocalizedString = LocalizationManager.Instance.GetDescription(key);
var tastes = SelectedItem.GetTasteDatas;
var tasteMat = SelectedItem.RecipeType switch
{

View File

@ -9,7 +9,6 @@ public class TasteHashTagSlotUi : MonoBehaviour
[field: SerializeField] public RectTransform RectTransform { get; private set; }
[SerializeField] private Image _backgroundImage;
[SerializeField] private TextMeshProUGUI _label;
[SerializeField] private LocalizeStringEvent _localizeStringEvent;
private Material _materialInstance;
@ -31,6 +30,6 @@ public void Initialize(Material material, TasteDataEntry tasteDataEntry)
_materialInstance = new Material(material);
_backgroundImage.material = _materialInstance;
_localizeStringEvent.StringReference = LocalizationManager.Instance.GetLocalizedName(tasteDataEntry.Id);
_label.text = LocalizationManager.Instance.GetName(tasteDataEntry.Id);
}
}