Beispiel #1
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());
        }
Beispiel #2
0
        //private bool early = false;
        private LuaLoader()
        {
            instance = this;
            beZip    = false;
            Debug.LogError("lua loader init->" + Application.platform);
            if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.WindowsPlayer)
            {
#if LUA_FILE_COMBINE
                Debug.LogError("lua loader init 1");
                combineFile = new CombineFile("all_lua.cf");
                Timer.CreateTimer(1, -1, DoUpdate, null);
#endif
            }
            else
            {
                Debug.LogError("lua loader init 2");
                AddSearchPath(Application.dataPath + "/Lua/?.lua");
                AddSearchPath(Application.dataPath + "/ToLua/Lua/?.lua");
                //AddSearchPath(Application.dataPath + "/ToLua/Lua/protobuf/?.lua");
                AddSearchPath(Application.dataPath + "/Lua/Proto/?.lua");
            }
        }