//-------------------------------------------------------------------------
    public override void createAssetLoad(string asset_path, string asset_name, AsyncAssetLoadGroup async_assetloadgroup, Action<UnityEngine.Object> loaded_action)
    {
        AssetPath = asset_path;

        RequestLoadAssetInfo request_loadassetinfo = new RequestLoadAssetInfo();
        request_loadassetinfo.AssetName = asset_name;
        request_loadassetinfo.LoadedAction = loaded_action;

        List<RequestLoadAssetInfo> list_requestloadasssetinfo = null;
        MapRequestLoadAssetInfo.TryGetValue(async_assetloadgroup, out list_requestloadasssetinfo);

        if (list_requestloadasssetinfo == null)
        {
            list_requestloadasssetinfo = new List<RequestLoadAssetInfo>();
        }

        list_requestloadasssetinfo.Add(request_loadassetinfo);

        MapRequestLoadAssetInfo[async_assetloadgroup] = list_requestloadasssetinfo;

        if (mAssetBundleCreateRequest == null)
        {
            mAssetBundleCreateRequest = AssetBundle.LoadFromFileAsync(asset_path);
        }
    }
        static int _m_LoadWWWAsync(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                AsyncAssetLoadGroup gen_to_be_invoked = (AsyncAssetLoadGroup)translator.FastGetCSObj(L, 1);



                {
                    string _url = LuaAPI.lua_tostring(L, 2);
                    System.Action <string, UnityEngine.WWW> _loaded_action = translator.GetDelegate <System.Action <string, UnityEngine.WWW> >(L, 3);

                    LoaderTicket gen_ret = gen_to_be_invoked.LoadWWWAsync(_url, _loaded_action);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_asyncLoadAsset(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                AsyncAssetLoadGroup gen_to_be_invoked = (AsyncAssetLoadGroup)translator.FastGetCSObj(L, 1);



                {
                    string _bundle_path = LuaAPI.lua_tostring(L, 2);
                    string _asset_name  = LuaAPI.lua_tostring(L, 3);
                    _eAsyncAssetLoadType _loader_type; translator.Get(L, 4, out _loader_type);
                    System.Action <LoaderTicket, string, UnityEngine.Object> _loaded_action = translator.GetDelegate <System.Action <LoaderTicket, string, UnityEngine.Object> >(L, 5);

                    LoaderTicket gen_ret = gen_to_be_invoked.asyncLoadAsset(_bundle_path, _asset_name, _loader_type, _loaded_action);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Ejemplo n.º 4
0
    //-------------------------------------------------------------------------
    public override void createAssetLoad(string asset_path, string asset_name, AsyncAssetLoadGroup async_assetloadgroup, Action <UnityEngine.Object> loaded_action)
    {
        AssetPath = asset_path;

        RequestLoadAssetInfo request_loadassetinfo = new RequestLoadAssetInfo();

        request_loadassetinfo.AssetName    = asset_name;
        request_loadassetinfo.LoadedAction = loaded_action;

        List <RequestLoadAssetInfo> list_requestloadasssetinfo = null;

        MapRequestLoadAssetInfo.TryGetValue(async_assetloadgroup, out list_requestloadasssetinfo);

        if (list_requestloadasssetinfo == null)
        {
            list_requestloadasssetinfo = new List <RequestLoadAssetInfo>();
        }

        list_requestloadasssetinfo.Add(request_loadassetinfo);

        MapRequestLoadAssetInfo[async_assetloadgroup] = list_requestloadasssetinfo;

        if (mAssetBundleCreateRequest == null)
        {
            mAssetBundleCreateRequest = AssetBundle.LoadFromFileAsync(asset_path);
        }
    }
Ejemplo n.º 5
0
        //---------------------------------------------------------------------
        public void Close()
        {
            if (SoundMgr != null)
            {
                SoundMgr.destroy();
                SoundMgr = null;
            }

            if (MemoryStream != null)
            {
                MemoryStream.Close();
                MemoryStream = null;
            }

            if (CasinosLua != null)
            {
                CasinosLua.Release();
                CasinosLua = null;
            }

            if (HeadIconMgr != null)
            {
                HeadIconMgr.destroy();
                HeadIconMgr = null;
            }

            AsyncAssetLoaderMgr = null;
            if (AsyncAssetLoadGroup != null)
            {
                AsyncAssetLoadGroup.destroy();
                AsyncAssetLoadGroup = null;
            }

            Screen.sleepTimeout = SleepTimeout.SystemSetting;
        }
    //-------------------------------------------------------------------------
    public void _asyncLoadAsset(_eAsyncAssetLoadType async_assetloadtype,
                                string asset_path, string asset_name,
                                Action <UnityEngine.Object> loaded_action, AsyncAssetLoadGroup group)
    {
        IAsyncAssetLoader asynce_assetloader = null;

        mMapIAsyncAssetLoader.TryGetValue(asset_path, out asynce_assetloader);
        if (asynce_assetloader == null)
        {
            switch (async_assetloadtype)
            {
            case _eAsyncAssetLoadType.WWW:
                asynce_assetloader = new WWWAsyncAssetLoader(this);
                break;

            case _eAsyncAssetLoadType.LoacalAB:
                asynce_assetloader = new LocalABAsyncAssetLoader(this);
                break;

            default:
                break;
            }
        }

        asynce_assetloader.createAssetLoad(asset_path, asset_name, group, loaded_action);

        mMapIAsyncAssetLoader[asset_path] = asynce_assetloader;
    }
        static int _m_asyncLoadLocalBundle(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                AsyncAssetLoadGroup gen_to_be_invoked = (AsyncAssetLoadGroup)translator.FastGetCSObj(L, 1);



                {
                    System.Collections.Generic.List <string> _list_bundle_path = (System.Collections.Generic.List <string>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List <string>));
                    _eAsyncAssetLoadType _loader_type; translator.Get(L, 3, out _loader_type);
                    System.Action <System.Collections.Generic.List <UnityEngine.AssetBundle> > _loaded_action = translator.GetDelegate <System.Action <System.Collections.Generic.List <UnityEngine.AssetBundle> > >(L, 4);

                    LoaderTicket gen_ret = gen_to_be_invoked.asyncLoadLocalBundle(_list_bundle_path, _loader_type, _loaded_action);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_asyncLoadBundle(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                AsyncAssetLoadGroup gen_to_be_invoked = (AsyncAssetLoadGroup)translator.FastGetCSObj(L, 1);



                {
                    string _bundle_path = LuaAPI.lua_tostring(L, 2);
                    _eAsyncAssetLoadType _loader_type; translator.Get(L, 3, out _loader_type);
                    System.Action <string, UnityEngine.AssetBundle> _loaded_action = translator.GetDelegate <System.Action <string, UnityEngine.AssetBundle> >(L, 4);

                    gen_to_be_invoked.asyncLoadBundle(_bundle_path, _loader_type, _loaded_action);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _g_get_IsCancel(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                AsyncAssetLoadGroup gen_to_be_invoked = (AsyncAssetLoadGroup)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsCancel);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Ejemplo n.º 10
0
        //---------------------------------------------------------------------
        public void Close()
        {
            if (TimerShaft != null)
            {
                TimerShaft.Destroy();
                TimerShaft = null;
            }

            if (SoundMgr != null)
            {
                SoundMgr.destroy();
                SoundMgr = null;
            }

            if (HeadIconMgr != null)
            {
                HeadIconMgr.destroy();
                HeadIconMgr = null;
            }

            if (SpineMgr != null)
            {
                SpineMgr.Destroy();
                SpineMgr = null;
            }

            AsyncAssetLoaderMgr = null;
            if (AsyncAssetLoadGroup != null)
            {
                AsyncAssetLoadGroup.destroy();
                AsyncAssetLoadGroup = null;
            }

            if (LuaMgr != null)
            {
                LuaMgr.Release();
                LuaMgr = null;
            }

            if (MemoryStream != null)
            {
                MemoryStream.Close();
                MemoryStream = null;
            }

            Screen.sleepTimeout = SleepTimeout.SystemSetting;
        }
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 2 && translator.Assignable <AsyncAssetLoaderMgr>(L, 2))
                {
                    AsyncAssetLoaderMgr _mgr = (AsyncAssetLoaderMgr)translator.GetObject(L, 2, typeof(AsyncAssetLoaderMgr));

                    AsyncAssetLoadGroup gen_ret = new AsyncAssetLoadGroup(_mgr);
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to AsyncAssetLoadGroup constructor!"));
        }
Ejemplo n.º 12
0
        //---------------------------------------------------------------------
        // 需要调整为可并发调用的接口
        public void LuaAsyncLoadLocalUiBundle(Action loaddone_callback, params string[] need_load_ab_path)
        {
            List <string> list_ab = new List <string>();

            foreach (var i in need_load_ab_path)
            {
                list_ab.Add(i);
            }

            AsyncAssetLoadGroup.asyncLoadLocalBundle(
                list_ab, _eAsyncAssetLoadType.LocalBundle, (List <AssetBundle> list_abex) =>
            {
                foreach (var i in list_abex)
                {
                    UIPackage.AddPackage(i);
                }

                loaddone_callback();
            });
        }
        static int _m_destroy(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                AsyncAssetLoadGroup gen_to_be_invoked = (AsyncAssetLoadGroup)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.destroy(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Ejemplo n.º 14
0
        static int _m_createAsyncAssetLoadGroup(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                AsyncAssetLoaderMgr gen_to_be_invoked = (AsyncAssetLoaderMgr)translator.FastGetCSObj(L, 1);



                {
                    AsyncAssetLoadGroup gen_ret = gen_to_be_invoked.createAsyncAssetLoadGroup(  );
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Ejemplo n.º 15
0
        //---------------------------------------------------------------------
        public void Close()
        {
            if (TimerShaft != null)
            {
                TimerShaft.Destroy();
                TimerShaft = null;
            }

            if (SoundMgr != null)
            {
                SoundMgr.destroy();
                SoundMgr = null;
            }

            if (HeadIconMgr != null)
            {
                HeadIconMgr.destroy();
                HeadIconMgr = null;
            }

            if (SpineMgr != null)
            {
                SpineMgr.Destroy();
                SpineMgr = null;
            }

            if (AsyncAssetLoadGroup != null)
            {
                AsyncAssetLoadGroup.destroy();
                AsyncAssetLoadGroup = null;
            }

            if (AsyncAssetLoaderMgr != null)
            {
                AsyncAssetLoaderMgr.Close();
                AsyncAssetLoaderMgr = null;
            }

            if (NetMgr != null)
            {
                NetMgr.Close();
                NetMgr = null;
            }

            if (NativeAPIMsgReceiverListner != null)
            {
                NativeAPIMsgReceiverListner.Close();
                NativeAPIMsgReceiverListner = null;
            }

            if (LuaMgr != null)
            {
                LuaMgr.Release();
                LuaMgr = null;
            }

            if (DelayMgr != null)
            {
                DelayMgr.Close();
                DelayMgr = null;
            }

            if (MemoryStream != null)
            {
                MemoryStream.Close();
                MemoryStream = null;
            }

            Screen.sleepTimeout = SleepTimeout.SystemSetting;
        }
Ejemplo n.º 16
0
 //-------------------------------------------------------------------------
 public abstract void createAssetLoad(string asset_path, string asset_name,
                                      AsyncAssetLoadGroup async_assetloadgroup, Action <UnityEngine.Object> loaded_action);
Ejemplo n.º 17
0
 //-------------------------------------------------------------------------
 public abstract void createAssetLoad(string asset_path, string asset_name,
     AsyncAssetLoadGroup async_assetloadgroup, Action<UnityEngine.Object> loaded_action);