示例#1
0
 static int setDesignContentScale(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         ScreenResolution obj = (ScreenResolution)ToLua.CheckObject(L, 1, typeof(ScreenResolution));
         obj.setDesignContentScale();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#2
0
    IEnumerator InitVersionAndBugly()
    {
        sr.AdjustResolution();
        sr.setDesignContentScale();
        //Util.AutoAdjustCameraRect(UICamera.mainCamera);
        Debug.Log(string.Format("Resolution: {0}", Screen.currentResolution));
        yield return(Yielders.GetWaitForSeconds(0.1f));

        string versionFile = string.Format("{0}{1}/version.txt", Util.AppContentPath(), LuaConst.osDir);

        Debug.Log(versionFile);
        string version = string.Empty;

        if (Application.isMobilePlatform && Application.platform == RuntimePlatform.Android)
        {
            WWW www = new WWW(versionFile);
            yield return(www);

            if (www.error != null)
            {
                Debug.LogError(www.error);
                version = Application.version;
            }
            else
            {
                version = www.text;
            }
            www.Dispose();
            Debug.Log(string.Format("package version: {0}", version));
        }
        else
        {
            if (File.Exists(versionFile))
            {
                version = File.ReadAllText(versionFile);
            }
            else
            {
                version = Application.version;
            }
        }
        GameManager.packVersion = GameVersion.CreateVersion(version);
        string localVersionFile = Path.Combine(Util.DataPath, "version.txt");

        GameManager.localVersion = GameVersion.CreateVersion(localVersionFile, GameManager.packVersion.ToString());

#if UNITY_EDITOR
        //BuglyAgent.ConfigDebugMode(true);
#else
        //BuglyAgent.ConfigDebugMode(false);
#endif
#if UNITY_IOS
        BuglyAgent.InitWithAppId("1ce5a132bc");
#elif UNITY_ANDROID
        //BuglyAgent.InitWithAppId("529dceaf06");
#endif
        BuglyAgent.SetUserId(string.Format("{0}:{1}", SystemInfo.deviceModel, SystemInfo.deviceName));
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogAssert);
        BuglyAgent.EnableExceptionHandler();

        InitOtherSetting();
        yield return(Yielders.GetWaitForSeconds(2f));

        SceneManager.LoadScene("UpdateScene");
    }