static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if (LuaAPI.lua_gettop(L) == 1) { AssetbundleUpdater gen_ret = new AssetbundleUpdater(); 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 AssetbundleUpdater constructor!")); }
IEnumerator InitLaunchPrefab() { var start = DateTime.Now; var loader = AssetBundleManager.Instance.LoadAssetAsync(launchPrefabPath, typeof(GameObject)); yield return loader; launchPrefab = loader.asset as GameObject; Logger.Log(string.Format("Load launchPrefab use {0}ms", (DateTime.Now - start).Milliseconds)); loader.Dispose(); if (launchPrefab == null) { Logger.LogError("LoadAssetAsync launchPrefab err : " + launchPrefabPath); yield break; } var go = InstantiateGameObject(launchPrefab); updater = go.AddComponent<AssetbundleUpdater>(); yield break; }
IEnumerator InitLaunchPrefab() { var loader = AssetBundleManager.Instance.LoadAssetAsync(launchPrefabPath, typeof(GameObject)); yield return(loader); launchPrefab = loader.asset as GameObject; loader.Dispose(); if (launchPrefab == null) { Logger.LogError("LoadAssetAsync launchPrefab err : " + launchPrefabPath); yield break; } var go = InstantiateGameObject(launchPrefab); UILauncher.Instance.UIGameObject = go; updater = go.AddComponent <AssetbundleUpdater>(); }
static int _m_StartCheckUpdate(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); AssetbundleUpdater gen_to_be_invoked = (AssetbundleUpdater)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.StartCheckUpdate( ); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
IEnumerator Start() { //初始化系统设置 TODO 国战需要用到双指缩放放大屏幕 所以把多指触摸打开 Input.multiTouchEnabled = true; //设置横竖屏幕模式 Screen.orientation = ScreenOrientation.AutoRotation; Screen.autorotateToLandscapeLeft = true; Screen.autorotateToLandscapeRight = true; Screen.autorotateToPortrait = false; Screen.autorotateToPortraitUpsideDown = false; //手机常亮模式 yield return(null); Screen.sleepTimeout = SleepTimeout.NeverSleep; Application.runInBackground = true; Application.targetFrameRate = 30; //首先检查游戏调试配置文件 GameDebugConfig.instance.Init(); LoggerHelper.Instance.Startup(); //自动更新可关闭 if (debugReport == null) { debugReport = GameObject.Find("Reporter"); } if (debugReport != null) { debugReport.SetActive(true); } if (GameDebugConfig.instance.IsConfigOK()) { AssetbundleUpdater.SetUpdateStatus(GameDebugConfig.instance.IsAutoUpdate()); bool bcshapdebug = GameDebugConfig.instance.IsCShapeDebugOpen(); Logger.SetLoggerState(bcshapdebug); //关闭report模式 if (debugReport != null) { Logger.Log("Setdebug reprot:" + bcshapdebug); debugReport.SetActive(bcshapdebug); } } Logger.Log(Application.persistentDataPath); #if UNITY_IPHONE UnityEngine.iOS.NotificationServices.RegisterForNotifications(UnityEngine.iOS.NotificationType.Alert | UnityEngine.iOS.NotificationType.Badge | UnityEngine.iOS.NotificationType.Sound); UnityEngine.iOS.Device.SetNoBackupFlag(Application.persistentDataPath); #endif // 初始化App版本 var start = DateTime.Now; yield return(InitAppVersion()); Logger.Log(string.Format("InitAppVersion use {0}ms", (DateTime.Now - start).Milliseconds)); // 初始化渠道 start = DateTime.Now; yield return(InitChannel()); Logger.Log(string.Format("InitChannel use {0}ms", (DateTime.Now - start).Milliseconds)); // 启动资源管理模块 start = DateTime.Now; yield return(AssetBundleManager.Instance.Initialize()); Logger.Log(string.Format("AssetBundleManager Initialize use {0}ms", (DateTime.Now - start).Milliseconds)); //// 启动xlua热修复模块 //start = DateTime.Now; //XLuaManager.Instance.Startup(); ////加载 lua //Coroutine co = StartCoroutine(AssetBundleManager.Instance.PreLoadLua()); //yield return co; //XLuaManager.Instance.OnInit(); //XLuaManager.Instance.StartHotfix(); //Logger.Log(string.Format("XLuaManager StartHotfix use {0}ms", (DateTime.Now - start).Milliseconds)); yield return(null); // 初始化UI界面 yield return(InitLaunchPrefab()); yield return(null); yield return(InitNoticeTipPrefab()); // 开始更新 if (updater != null) { updater.StartCheckUpdate(); } yield break; }