// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { I18NManager.getInstance().setLanguage(SystemLanguage.Chinese); I18NManager.getInstance().reset(); } if (Input.GetMouseButtonUp(0)) { I18NManager.getInstance().setLanguage(SystemLanguage.English); I18NManager.getInstance().reset(); } }
// Use this for initialization void Start() { label = GetComponent <UILabel>(); if (label == null) { throw new System.Exception("Not found!"); } if (label.bitmapFont == null) { throw new System.Exception("Not found font!"); } fontSize = label.bitmapFont.defaultSize; I18NManager.getInstance().addObserver(this); }
void OnDestroy() { I18NManager.getInstance().deleteObserver(this); }
static void Main(string[] args) { I18NManager.getInstance().push(1, "注册成功,您的账号是{0},密码是{1},价格是{2:F0}"); System.Console.WriteLine("I18N:" + I18NManager.getInstance().getString(1, 'a', 2, 25.69)); System.Console.ReadKey(); }
void OnDestroy() { print("OnDestroy"); I18NManager.getInstance().deleteObserver(this); }
void Awake() { I18NManager.getInstance().setLanguage(SystemLanguage.English); I18NManager.getInstance().reset(); }