多轮审查和修复
This commit is contained in:
24
Assets/Scripts/Localization/ILocalizationService.cs
Normal file
24
Assets/Scripts/Localization/ILocalizationService.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace BaseGames.Localization
|
||||
{
|
||||
/// <summary>
|
||||
/// 本地化服务接口。通过 ServiceLocator 注册,供 UI 和游戏系统获取本地化文本。
|
||||
/// </summary>
|
||||
public interface ILocalizationService
|
||||
{
|
||||
/// <summary>当前激活的语言。</summary>
|
||||
Language CurrentLanguage { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取本地化字符串。查找顺序:当前语言 → 回退语言(English)→ 直接返回 key。
|
||||
/// </summary>
|
||||
string Get(string key, string table = "UI");
|
||||
|
||||
/// <summary>切换游戏语言并通知所有订阅者刷新文本。</summary>
|
||||
void SetLanguage(Language language);
|
||||
|
||||
/// <summary>语言切换时触发。</summary>
|
||||
event Action<Language> OnLanguageChanged;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user