Exemplo n.º 1
0
        private void BeforeInit()
        {
            //platform
            Debug.LogError("game start before init");
            if (Application.platform == RuntimePlatform.Android)
            {
                Debug.LogError("game start before init->android platform init");
                AndroidPlatform.Init();
                Debug.LogError("game start before init->android asset file stream init");
                AndroidAssetFileStream.Init();
            }

            gameObject.AddComponent <ResUpdate>();

            GameObject go = new GameObject();

            go.AddComponent <WwwWorkpool>();
            Object.DontDestroyOnLoad(go);

            gameObject.AddComponent <ResLoader>();
            gameObject.AddComponent <GameSceneManager>();
            gameObject.AddComponent <GameTime>();

            LuaLoader.GetInstance();
        }
Exemplo n.º 2
0
 void OnApplicationQuit()
 {
     NetworkManager.CloseAll();
     LuaCThread.CloseAll();
     LuaManager.Dispose();
     LuaContext.DisposeAll();
     LuaLoader.GetInstance().Clean();
     MessagePool.ScriptSendMessage("", MessagePool.OnApplicationQuit, Message.FilterTypeNothing, "OnApplicationQuit");
 }
Exemplo n.º 3
0
        private void DoOver()
        {
            Debugger.LogError(">>>>>>>>>>>>>>>>>>>>>>Update Over<<<<<<<<<<<<<<<<<<<<<<<<<<");

            if (doCheckUF != null)
            {
                doCheckUF(1f);
            }

            SetFileLocate();

            over      = true;
            canUpdate = false;

            vfc         = null;
            versionInfo = null;
            if (needUpdateList != null)
            {
                needUpdateList.Clear();
                needUpdateList = null;
            }

            streamingAssetVersionInfo = null;

            if (doUpdateUIOver != null)
            {
                doUpdateUIOver();
                curFileSize = 0;
            }

            if (reMs != null)
            {
                reMs.Dispose();
                reMs = null;
            }

            //load newer lua
            LuaLoader.GetInstance().Reset();

            MessagePool.CSSendMessage(null, MessagePool.UpdateResOver, Message.FilterTypeNothing, "");

            //test
            Dictionary <string, RelationData> .Enumerator e = nameToRelation.GetEnumerator();
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            while (e.MoveNext())
            {
                sb.Append(e.Current.Key);
                sb.Append("\r\n");
            }

            Debug.Log("all version files->" + sb.ToString());
        }