fix: 3D文字(Text3DCtrl)本地化+车辆名称提示翻译
- Text3DCtrl: SetName使用LocalizationManager.Get翻译,订阅LanguageChanged - StudentSub2EditorPanel: 未规划车辆提示中车辆名称用Get翻译+去除括号后缀
This commit is contained in:
parent
df1cdf7bcd
commit
8941d8b497
@ -8,6 +8,7 @@ public class Text3DCtrl : MonoBehaviour
|
||||
public LookAtState LookAtState = LookAtState.LookAt;
|
||||
Transform targetTrans;
|
||||
float angleX;
|
||||
string sourceText;
|
||||
|
||||
public void SetLayer(string LayerName)
|
||||
{
|
||||
@ -46,7 +47,8 @@ public class Text3DCtrl : MonoBehaviour
|
||||
|
||||
public void SetName(string text)
|
||||
{
|
||||
textMesh.text = text;
|
||||
sourceText = text;
|
||||
textMesh.text = LocalizationManager.Get(text);
|
||||
}
|
||||
|
||||
//选选取的时候 改变文字颜色
|
||||
@ -54,6 +56,22 @@ public class Text3DCtrl : MonoBehaviour
|
||||
{
|
||||
textMesh.color = newColor;
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
LocalizationManager.LanguageChanged += OnLanguageChanged;
|
||||
}
|
||||
|
||||
private void OnLanguageChanged()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(sourceText))
|
||||
textMesh.text = LocalizationManager.Get(sourceText);
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
LocalizationManager.LanguageChanged -= OnLanguageChanged;
|
||||
}
|
||||
}
|
||||
|
||||
public enum LookAtState
|
||||
|
||||
@ -308,7 +308,7 @@ public class StudentSub2EditorPanel : BasePanel
|
||||
{
|
||||
if (carCtrls[i].CarState != CarState.opened)
|
||||
{
|
||||
prompt_editorOverButton.SetPrompt(LocalizationManager.Format("存在未规划的车辆{0}!", carCtrls[i].gameObject.name), Color.red, 3);
|
||||
prompt_editorOverButton.SetPrompt(LocalizationManager.Format("存在未规划的车辆{0}!", LocalizationManager.Get(carCtrls[i].gameObject.name.Split('(')[0])), Color.red, 3);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user