案例:Assets/Scripts/Example/3.UIFrame/ChangePanelByLanuage/Lanuagepanel.unity
1).UI脚本
请注意第三个参数要设置为true,否则不会添加AFStart中的LanuageSuffix
[AFUI(500, "Assets/ResForAB/ABMain/Prefabs/Lanuage/LanuageTest", true)]
public class LanuageUIScript : UIPanelParent
{
}
2).调用AFStart.Instance.ChangeLanuageSuffix切换语言后缀
int SuffixIndex = 0;
string[] SuffixStr = {"CHA","ENG" };
string[] BtnStr = { "切换成英文UI", "切换成中文UI" };
public Text btnText;
public void ChangeLanuageBtn()
{
if(SuffixIndex == 1)
{
SuffixIndex = 0;
}
else
{
SuffixIndex = 1;
}
btnText.text = BtnStr[SuffixIndex];
AFStart.Instance.ChangeLanuageSuffix(SuffixStr[SuffixIndex]);
//关闭之前的UI
lanuageUIScript.CloseSelf();
lanuageUIScript = UIManager.Instance.OpenUI<LanuageUIScript>(500);
}