//-------------------------------------------------------------------------
 public LocalBundleAsyncLoader(AsyncAssetLoaderMgr mgr)
 {
     AsyncAssetLoaderMgr         = mgr;
     MapAssetBundle              = new Dictionary <string, AssetBundle>();
     MapAssetBundleCreateRequest = new Dictionary <string, AssetBundleCreateRequest>();
     MapLoaderTicketAndCallBack  = new Dictionary <string, Action <string, AssetBundle> >();
 }
示例#2
0
    //-------------------------------------------------------------------------
    internal override void destory()
    {
        AsyncAssetLoaderMgr._destroyAsyncAssetLoader(AssetPath);

        mAsyncAssetWWW.Dispose();
        mAsyncAssetWWW = null;
    }
示例#3
0
        //---------------------------------------------------------------------
        public void Update(float elapsed_tm)
        {
            if (SoundMgr != null)
            {
                SoundMgr.update();
            }

            if (FTMgr != null)
            {
                FTMgr.update(elapsed_tm);
            }

            if (NetBridge != null)
            {
                NetBridge.update(elapsed_tm);
            }

            if (AsyncAssetLoaderMgr != null)
            {
                AsyncAssetLoaderMgr.update(Time.deltaTime);
            }

            if (CasinosLua != null)
            {
                CasinosLua.Update(elapsed_tm);
            }

            if (TimerShaft != null)
            {
                TimerShaft.ProcessTimer((ulong)Stopwatch.ElapsedMilliseconds);
            }
        }
 //-------------------------------------------------------------------------
 public LocalAssetAsyncLoader(AsyncAssetLoaderMgr mgr)
 {
     AsyncAssetLoaderMgr        = mgr;
     MapBundle                  = new Dictionary <string, AssetBundle>();
     MapBundleAsset             = new Dictionary <string, UnityEngine.Object>();
     MapLoaderTicketAndCallBack = new Dictionary <string, Dictionary <LoaderTicket, Action <LoaderTicket, string, UnityEngine.Object> > >();
 }
示例#5
0
    //Dictionary<string, AssetBundle> MapAssetBundle { get; set; }
    //List<LoaderTicket> ListCallBackDoneTicket { get; set; }

    //-------------------------------------------------------------------------
    public WWWBundleAsyncLoader(AsyncAssetLoaderMgr mgr)
    {
        AsyncAssetLoaderMgr        = mgr;
        MapLoaderTicketAndCallBack = new Dictionary <string, Action <string, AssetBundle> >();

        //MapAssetBundle = new Dictionary<string, AssetBundle>();
        //ListCallBackDoneTicket = new List<LoaderTicket>();
    }
示例#6
0
    //List<LoaderTicket> ListCallBackDoneTicket { get; set; }

    //-------------------------------------------------------------------------
    public WWWAsyncLoader(AsyncAssetLoaderMgr mgr)
    {
        AsyncAssetLoaderMgr = mgr;
        MapWWW       = new Dictionary <string, WWW>();
        MapWWWIsDone = new Dictionary <string, WWW>();
        MapLoaderTicketAndCallBack = new Dictionary <string, Action <string, WWW> >();

        //ListCallBackDoneTicket = new List<LoaderTicket>();
    }
示例#7
0
 //-------------------------------------------------------------------------
 public AsyncAssetLoadGroup(AsyncAssetLoaderMgr mgr)
 {
     IsCancel                   = false;
     AsyncAssetLoaderMgr        = mgr;
     MapAssetBundle             = new Dictionary <string, AssetBundle>();
     MapLoadAssetBundleCallBack = new Dictionary <string, Action <string, AssetBundle> >();
     MapLoaderTicket            = new Dictionary <LoaderTicket, Action <List <AssetBundle> > >();
     ListLoaderAssetBundlesDone = new List <LoaderTicket>();
 }
示例#8
0
    //-------------------------------------------------------------------------
    internal override void destory()
    {
        AsyncAssetLoaderMgr._destroyAsyncAssetLoader(AssetPath);

        if (mAssetBundleCreateRequest != null && mAssetBundleCreateRequest.assetBundle != null)
        {
            mAssetBundleCreateRequest.assetBundle.Unload(false);
        }
        mAssetBundleCreateRequest = null;
    }
示例#9
0
        static int _g_get_LocalAssetAsyncLoader(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                AsyncAssetLoaderMgr gen_to_be_invoked = (AsyncAssetLoaderMgr)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.LocalAssetAsyncLoader);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
示例#10
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    AsyncAssetLoaderMgr gen_ret = new AsyncAssetLoaderMgr();
                    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 AsyncAssetLoaderMgr constructor!"));
        }
        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!"));
        }
示例#12
0
        //---------------------------------------------------------------------
        public void Update(float elapsed_tm)
        {
            if (SoundMgr != null)
            {
                SoundMgr.Update();
            }

            if (FTMgr != null)
            {
                FTMgr.Update(elapsed_tm);
            }

            if (DelayMgr != null)
            {
                DelayMgr.Update(elapsed_tm);
            }

            if (NetMgr != null)
            {
                NetMgr.Update(elapsed_tm);
            }

            if (AsyncAssetLoaderMgr != null)
            {
                AsyncAssetLoaderMgr.Update(Time.deltaTime);
            }

            if (LuaMgr != null)
            {
                LuaMgr.Update(elapsed_tm);
            }

            if (TimerShaft != null)
            {
                TimerShaft.ProcessTimer((ulong)Stopwatch.ElapsedMilliseconds);
            }

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                LuaMgr._CSharpCallOnAndroidQuitConfirm();
            }
        }
示例#13
0
        static int _m_Close(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    gen_to_be_invoked.Close(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
示例#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));
            }
        }
示例#15
0
        static int _m_Update(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    float _time = (float)LuaAPI.lua_tonumber(L, 2);

                    gen_to_be_invoked.Update(_time);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
 //-------------------------------------------------------------------------
 public LocalABAsyncAssetLoader(AsyncAssetLoaderMgr mgr)
     : base(mgr)
 {
     MapRequestLoadAssetInfo = new Dictionary<AsyncAssetLoadGroup, List<RequestLoadAssetInfo>>();
 }
示例#17
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;
        }
示例#18
0
 //-------------------------------------------------------------------------
 public LocalABAsyncAssetLoader(AsyncAssetLoaderMgr mgr)
     : base(mgr)
 {
     MapRequestLoadAssetInfo = new Dictionary <AsyncAssetLoadGroup, List <RequestLoadAssetInfo> >();
 }
示例#19
0
        //---------------------------------------------------------------------
        public CasinosContext(bool force_use_resouceslaunch, bool force_use_dataoss)
        {
            Instance = this;

            _eEditorRunSourcePlatform editor_runsorce = _eEditorRunSourcePlatform.Android;

#if UNITY_STANDALONE_WIN
            editor_runsorce = _eEditorRunSourcePlatform.PC;
#elif UNITY_ANDROID && UNITY_EDITOR
            editor_runsorce = _eEditorRunSourcePlatform.Android;
#elif UNITY_ANDROID
            editor_runsorce = _eEditorRunSourcePlatform.Android;
#elif UNITY_IPHONE
            editor_runsorce = _eEditorRunSourcePlatform.IOS;
#endif

#if UNITY_EDITOR
            IsEditor = true;
#else
            IsEditor = false;
#endif

#if UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER
            IsSqliteUnity = true;
#else
            IsSqliteUnity = false;
#endif

#if UNITY_IOS
            string version            = UnityEngine.iOS.Device.systemVersion;
            var    arr_version        = version.Split('.');
            int    first_version_code = 0;
            if (arr_version.Length > 0)
            {
                int.TryParse(arr_version[0].ToString(), out first_version_code);
            }
            if (first_version_code < 9)
            {
                UseHttps = false;
            }
            else
            {
                UseHttps = true;
            }
            UnityIOS     = true;
            UnityAndroid = false;
#elif UNITY_ANDROID
            UseHttps     = false;
            UnityAndroid = true;
            UnityIOS     = false;
#elif UNITY_STANDALONE_WIN
#endif

            Stopwatch = new System.Diagnostics.Stopwatch();
            Stopwatch.Start();
            TimerShaft   = new TimerShaft();
            MemoryStream = new MemoryStream();
            SB           = new StringBuilder();
            FTMgr        = new FTMgr();
            PathMgr      = new PathMgr(editor_runsorce, force_use_resouceslaunch, force_use_dataoss);// 初始化PathMgr
            Config       = new CasinosConfig(editor_runsorce);
            NativeMgr    = new NativeMgr();
            SpineMgr     = new SpineMgr();

            // 初始化系统参数
            {
#if UNITY_EDITOR
                Application.runInBackground = false;
                Screen.sleepTimeout         = SleepTimeout.SystemSetting;
                QualitySettings.vSyncCount  = 0;
                Application.targetFrameRate = -1;
#else
                Application.runInBackground = true;
                Screen.sleepTimeout         = SleepTimeout.NeverSleep;
                QualitySettings.vSyncCount  = 1;
                Application.targetFrameRate = 60;
#endif
            }

            if (NativeAPIMsgReceiverListner == null)
            {
                NativeAPIMsgReceiverListner = new NativeAPIMsgReceiverListener();
            }

            if (AsyncAssetLoaderMgr == null)
            {
                AsyncAssetLoaderMgr = new AsyncAssetLoaderMgr();
            }
            AsyncAssetLoadGroup = AsyncAssetLoaderMgr.createAsyncAssetLoadGroup();
            NetMgr      = new NetMgr();
            PlayerPrefs = new CasinosPlayerPrefs();
            TextureMgr  = new TextureMgr();
            UIObjectFactory.SetLoaderExtension(typeof(GLoaderEx));
            LuaMgr      = new LuaMgr();
            SoundMgr    = new SoundMgr();
            HeadIconMgr = new HeadIconMgr();
        }
 //-------------------------------------------------------------------------
 public AsyncAssetLoadGroup(AsyncAssetLoaderMgr mgr)
 {
     IsCancel = false;
     AsyncAssetLoaderMgr = mgr;
 }
示例#21
0
 //-------------------------------------------------------------------------
 public AsyncAssetLoadGroup(AsyncAssetLoaderMgr mgr)
 {
     IsCancel            = false;
     AsyncAssetLoaderMgr = mgr;
 }
示例#22
0
 //-------------------------------------------------------------------------
 public IAsyncAssetLoader(AsyncAssetLoaderMgr mgr)
 {
     AsyncAssetLoaderMgr = mgr;
 }
 //-------------------------------------------------------------------------
 public IAsyncAssetLoader(AsyncAssetLoaderMgr mgr)
 {
     AsyncAssetLoaderMgr = mgr;
 }
示例#24
0
        //---------------------------------------------------------------------
        public CasinosContext(CasinosListener listener,
                              bool use_persistent,
                              string lua_project_listener_name,
                              string ui_pathroot,
                              string resourcesrow_pathroot,
                              string ab_resource_title,
                              string lotteryticket_factoryname)
        {
            _eEditorRunSourcePlatform editor_runsorce = _eEditorRunSourcePlatform.Android;

#if UNITY_STANDALONE_WIN
            editor_runsorce = _eEditorRunSourcePlatform.PC;
#elif UNITY_ANDROID && UNITY_EDITOR
            editor_runsorce = _eEditorRunSourcePlatform.Android;
#elif UNITY_ANDROID
            editor_runsorce = _eEditorRunSourcePlatform.Android;
#elif UNITY_IPHONE
            editor_runsorce = _eEditorRunSourcePlatform.IOS;
#endif

            Instance                 = this;
            ABResourcePathTitle      = ab_resource_title;
            ResourcesRowPathRoot     = resourcesrow_pathroot;
            UiPathRoot               = ui_pathroot;
            WeiChatIsInstalled       = true;
            ShowWeiChat              = true;
            UseBindPhoneAndWeiChat   = false;
            LuaProjectListenerName   = lua_project_listener_name;
            LotteryTicketFactoryName = lotteryticket_factoryname;
            UseLan = true;
            _checkLan();

#if UNITY_EDITOR
            IsEditor = true;
#else
            IsEditor = false;
#endif

#if UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER
            IsSqliteUnity = true;
#else
            IsSqliteUnity = false;
#endif

#if IsDev
            IsDev = true;
#else
            IsDev = false;
#endif

#if UNITY_IOS
            PlatformName = "IOS";
            string version            = UnityEngine.iOS.Device.systemVersion;
            var    arr_version        = version.Split('.');
            int    first_version_code = 0;
            if (arr_version.Length > 0)
            {
                int.TryParse(arr_version[0].ToString(), out first_version_code);
            }
            if (first_version_code < 9)
            {
                UseHttps = false;
            }
            else
            {
                UseHttps = true;
            }
            UnityIOS     = true;
            UnityAndroid = false;
#elif UNITY_ANDROID
            PlatformName = "ANDROID";
            UseHttps     = false;
            UnityAndroid = true;
            UnityIOS     = false;
#elif UNITY_STANDALONE_WIN
            PlatformName = "PC";
#endif
            NativeMgr = new NativeMgr();
            PathMgr   = new PathMgr(editor_runsorce, use_persistent);// 初始化PathMgr
            FTMgr     = new FTMgr();
            Stopwatch = new System.Diagnostics.Stopwatch();
            Stopwatch.Start();
            TimerShaft = new TimerShaft();

            Listener     = listener;
            MemoryStream = new MemoryStream();
            SB           = new StringBuilder();
            Config       = new CasinosConfig(editor_runsorce);

            //Config = GameObject.FindObjectOfType<MbCasinosConfig>();
            //Config.FormatConfigUrl();
            //UserConfig = GameObject.FindObjectOfType<MbCasinosUserConfig>();

            // 初始化系统参数
            {
#if UNITY_EDITOR
                Application.runInBackground = false;
                Screen.sleepTimeout         = SleepTimeout.SystemSetting;
#else
                Application.runInBackground = true;
                Screen.sleepTimeout         = SleepTimeout.NeverSleep;
#endif
                Time.fixedDeltaTime        = 0.03f;
                QualitySettings.vSyncCount = 1;
                //Application.targetFrameRate = 30;
            }

            // 初始化日志
            {
                EbLog.NoteCallback    = Debug.Log;
                EbLog.WarningCallback = Debug.LogWarning;
                EbLog.ErrorCallback   = Debug.LogError;
            }

            if (NativeAPIMsgReceiverListner == null)
            {
                NativeAPIMsgReceiverListner = new NativeAPIMsgReceiverListener();
            }

            if (AsyncAssetLoaderMgr == null)
            {
                AsyncAssetLoaderMgr = new AsyncAssetLoaderMgr();
            }

            AsyncAssetLoadGroup = AsyncAssetLoaderMgr.createAsyncAssetLoadGroup();

            NetBridge = new NetBridge();

            PlayerPrefs = new CasinosPlayerPrefs();

            TextureMgr = new TextureMgr();

            UIObjectFactory.SetLoaderExtension(typeof(GLoaderEx));

            CasinosLua  = new CasinosLua();
            SoundMgr    = new CSoundMgr();
            HeadIconMgr = new HeadIconMgr();

            //CopyStreamingAssetsToPersistentDataPath = new CopyStreamingAssetsToPersistentDataPath();
            //Launch = new Launch();
        }