コード例 #1
0
ファイル: Launcher.cs プロジェクト: sorfgame/unity3d-lolo
        /// <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());
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        void OnDestroy()
        {
            if (m_language == string.Empty || m_languages.Length == 0 || m_languageIdx == -1)
            {
                return;
            }

            LocalizationText.RefreshLanguage();
        }
コード例 #4
0
        protected virtual void OnEnable()
        {
            m_target      = (LocalizationText)target;
            m_languageKey = serializedObject.FindProperty("m_languageKey");

            if (LocalizationText.langeuage == null)
            {
                LocalizationText.RefreshLanguage();
            }
        }
コード例 #5
0
 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));
     }
 }
コード例 #6
0
 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));
     }
 }
コード例 #7
0
    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"));
        }
    }
コード例 #8
0
    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"));
        }
    }