Story流程+本地化
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using Ichni.Localization;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Localization.Settings;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.Story
|
||||
@@ -162,8 +162,8 @@ namespace Ichni.Story
|
||||
_activeTalk = Instantiate(helperTalkPrefab, helperTalkContainer);
|
||||
_activeTalk.Closed += HandleTalkClosed;
|
||||
_activeTalk.Show(
|
||||
GetLocalizedText(helperData, helperData.displayNameKey, helperData.name),
|
||||
GetLocalizedText(helperData, contentKey, contentKey));
|
||||
LocalizationTextService.Resolve(helperData.localizationTable, helperData.displayNameKey, helperData.name),
|
||||
LocalizationTextService.Resolve(helperData.localizationTable, contentKey, contentKey));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -322,24 +322,6 @@ namespace Ichni.Story
|
||||
visualPresenter?.ApplyHelper(helperData);
|
||||
}
|
||||
|
||||
/// <summary>本地化失败时显示 Key,确保测试阶段仍能定位缺失条目,而不是得到空白气泡。</summary>
|
||||
private string GetLocalizedText(StoryHelperData helperData, string key, string fallback)
|
||||
{
|
||||
if (string.IsNullOrEmpty(key) || helperData == null)
|
||||
return fallback;
|
||||
|
||||
try
|
||||
{
|
||||
string localized = LocalizationSettings.StringDatabase.GetLocalizedString(helperData.localizationTable, key);
|
||||
return string.IsNullOrEmpty(localized) ? fallback : localized;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Debug.LogWarning($"[StoryHelper] 无法本地化 Key '{key}',将回退显示 '{fallback}'。{exception.Message}", this);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
|
||||
private void CacheBaseTransforms()
|
||||
{
|
||||
if (idleRoot != null)
|
||||
|
||||
Reference in New Issue
Block a user