/// <summary> /// 重启项目(动更完成后) /// </summary> private void Relaunch() { // destroy Common.luaMgr.Destroy(); Destroy(Common.looper); Destroy(Stage.uiCanvas.gameObject); // clear reference Stage.ClearReference(); AudioManager.ClearReference(); SafeAreaLayout.ClearReference(); LocalizationText.ClearReference(); ViewPager.ClearReference(); TcpSocket.ClearReference(); UdpSocket.ClearReference(); NetHelper.ClearReference(); DestroyEventDispatcher.ClearReference(); PointerEventDispatcher.ClearReference(); TriggerEventDispatcher.ClearReference(); DragDropEventDispatcher.ClearReference(); StageTouchEventDispatcher.ClearReference(); AvailabilityEventDispatcher.ClearReference(); // unload ResManager.UnloadAll(); // relaunch StartCoroutine(Launch()); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(m_languageKey, m_c_languageKey); serializedObject.ApplyModifiedProperties(); // m_target.languageKey = m_target.languageKey.Trim (); if (GUILayout.Button(m_c_apply, EditorStyles.miniButton, m_w50)) { m_target.DisplayContent(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(new GUIContent("langeuage: " + LocalizationText.langeuage, "当前使用的语言包"), m_labelWidth); if (GUILayout.Button(m_c_open, EditorStyles.miniButton)) { LanguageWindow.Open(m_target.languageKey.Trim()); } if (GUILayout.Button(m_c_refresh, EditorStyles.miniButton)) { LocalizationText.RefreshLanguage(); m_target.DisplayContent(); } EditorGUILayout.EndHorizontal(); }
void OnDestroy() { if (m_language == string.Empty || m_languages.Length == 0 || m_languageIdx == -1) { return; } LocalizationText.RefreshLanguage(); }
protected virtual void OnEnable() { m_target = (LocalizationText)target; m_languageKey = serializedObject.FindProperty("m_languageKey"); if (LocalizationText.langeuage == null) { LocalizationText.RefreshLanguage(); } }
static int DisplayContent(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); ShibaInu.LocalizationText obj = (ShibaInu.LocalizationText)ToLua.CheckObject <ShibaInu.LocalizationText>(L, 1); obj.DisplayContent(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SetText(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); ShibaInu.LocalizationText obj = (ShibaInu.LocalizationText)ToLua.CheckObject <ShibaInu.LocalizationText>(L, 1); string arg0 = ToLua.CheckString(L, 2); obj.SetText(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_languageKey(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); ShibaInu.LocalizationText obj = (ShibaInu.LocalizationText)o; string arg0 = ToLua.CheckString(L, 2); obj.languageKey = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index languageKey on a nil value")); } }
static int get_languageKey(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); ShibaInu.LocalizationText obj = (ShibaInu.LocalizationText)o; string ret = obj.languageKey; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index languageKey on a nil value")); } }