示例#1
0
    IEnumerator Start()
    {
#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
        InitLaunchBootBg();
        // 初始化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();
        string luaAssetbundleName = XLuaManager.Instance.AssetbundleName;
        AssetBundleManager.Instance.SetAssetBundleResident(luaAssetbundleName, true);
        var abloader = AssetBundleManager.Instance.LoadAssetBundleAsync(luaAssetbundleName);
        yield return(abloader);

        abloader.Dispose();
        XLuaManager.Instance.OnInit();
        XLuaManager.Instance.StartHotfix();
        Logger.Log(string.Format("XLuaManager StartHotfix use {0}ms", (DateTime.Now - start).Milliseconds));

        // 初始化UI界面
        yield return(InitLaunchPrefab());

        yield return(null);

        DeleteLaunchBootBg();
        yield return(InitNoticeTipPrefab());

        // 开始更新
        if (updater != null)
        {
            updater.StartCheckUpdate();
        }

        // 启动easytouch扩展管理
        start = DateTime.Now;
        Sword.SceneRootManager.instance.Init();
        Sword.EventManager.instance.Init();
        Sword.TouchManager.instance.Init();
        Logger.Log(string.Format("TouchMgr Init use {0}ms", (DateTime.Now - start).Milliseconds));
    }
示例#2
0
    IEnumerator Start()
    {
        LoggerHelper.Instance.Startup();
        //注释掉IOS的推送服务
        //#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

        Application.targetFrameRate = 30;
        // 初始化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();
        string luaAssetbundleName = XLuaManager.Instance.AssetbundleName;

        AssetBundleManager.Instance.SetAssetBundleResident(luaAssetbundleName, true);
        var abloader = AssetBundleManager.Instance.LoadAssetBundleAsync(luaAssetbundleName);

        yield return(abloader);

        //abloader.Dispose();
        XLuaManager.Instance.OnInit();
        XLuaManager.Instance.StartHotfix();
        Logger.Log(string.Format("XLuaManager StartHotfix use {0}ms", (DateTime.Now - start).Milliseconds));

        //// 初始化UI界面
        yield return(InitLaunchPrefab());

        yield return(null);

        yield return(InitNoticeTipPrefab());

        // 开始更新
        if (updater != null)
        {
            updater.StartCheckUpdate();
        }
        yield break;
    }
        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));
            }
        }
示例#4
0
    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;
    }
示例#5
0
    IEnumerator Start()
    {
        //注释掉IOS的推送服务
//#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

        // 启动资源管理模块
        var start = DateTime.Now;

        yield return(AssetBundleManager.Instance.Initialize());

        Logger.Log(string.Format("AssetBundleManager Initialize use {0}ms", (DateTime.Now - start).Milliseconds));

        yield return(null);

        // 初始化UI界面
        start = DateTime.Now;
        yield return(InitLaunchPrefab());

        Logger.Log(string.Format("Load launchPrefab use {0}ms", (DateTime.Now - start).Milliseconds));

        // 初始化App版本
        start = DateTime.Now;
        yield return(InitAppVersion());

        Logger.Log(string.Format("Init AppVersion use {0}ms", (DateTime.Now - start).Milliseconds));

        // 初始化渠道
        start = DateTime.Now;
        yield return(InitChannel());

        Logger.Log(string.Format("Init Channel use {0}ms", (DateTime.Now - start).Milliseconds));

        // 初始化SDK
        start = DateTime.Now;
        yield return(InitSDK());

        Logger.Log(string.Format("Init SDK use {0}ms", (DateTime.Now - start).Milliseconds));

        yield return(null);

        start = DateTime.Now;
        yield return(InitNoticeTipPrefab());

        Logger.Log(string.Format("Load noticeTipPrefab use {0}ms", (DateTime.Now - start).Milliseconds));

        // 开始更新
        start = DateTime.Now;
        yield return(updater.StartCheckUpdate());

        Logger.Log(string.Format("CheckUpdate use {0}ms", (DateTime.Now - start).Milliseconds));
        Destroy(updater);
        yield return(null);

        // 启动xlua框架
        start = DateTime.Now;
        XLuaManager.Instance.Startup();
        yield return(StartGame());

        Logger.Log(string.Format("XLuaManager StartUp use {0}ms", (DateTime.Now - start).Milliseconds));
    }