Example #1
0
 void OnApplicationQuit()
 {
     isQuit = true;
     JZLog.Log("Quit GameWorld");
     NetworkManager.instance.Close();
     ResHelper.Instance().StopDownloadHttp();
 }
Example #2
0
        public void SetEndValue(float endValue, string loadingHint = null, Action onProgressEnd = null)
        {
#if UNITY_EDITOR
            if (endValue < 1f)
            {
                JZLog.Log(" ===== 加载进度条到 ====>> " + endValue);
            }
            else
            {
                JZLog.Log(" ===== 结束加载进度条 ====>> ");
            }
#endif

            m_endValue = endValue;
            if (m_endValue - m_curValue > 0.2f)
            {
                m_speed = (m_endValue - m_curValue) / 12;
            }

            if (null != loadingHint)
            {
                txtLoadingHint.text = loadingHint;
            }

            if (endValue >= 1f)
            {
                if (null != onProgressEnd)
                {
                    m_onProgressEnd = onProgressEnd;
                }
            }
        }
Example #3
0
        public void StartProgress(float endValue, string loadingHint, string imgBG)
        {
#if UNITY_EDITOR
            JZLog.Log(" ===== 开始加载进度条到 ====>> " + endValue);
#endif

            m_endValue          = endValue;
            txtLoadingHint.text = loadingHint;
            P_SetProgress(0f);
        }
Example #4
0
        public void StartProgress(int career, float endValue, string loadingHint)
        {
#if UNITY_EDITOR
            JZLog.Log(" ===== 开始加载进度条到 ====>> " + endValue);
#endif

            m_endValue            = endValue;
            m_txtLoadingHint.text = loadingHint;
            P_SetProgress(0f);
            m_startRotation = true;
        }
Example #5
0
    private string M_GetOT(Language language, string key)
    {
        if (m_ots.ContainsKey(language))
        {
            Dictionary <string, string> content = m_ots[language];
            if (content.ContainsKey(key))
            {
                return(content[key]);
            }
        }

        JZLog.Log(" 没有该多语言配置:" + language.ToString() + " ==> " + key);
        return("");
    }
Example #6
0
    IEnumerator ReadLocalConfig(Action onComplete, Action onError)
    {
        string path = PathUtils.MakeFilePath(GameConfig.LOCAL_CONFIG_FILE, PathUtils.PathType.MobileDiskWrite);

        try
        {
            if (File.Exists(path))
            {
                Loom.RunAsync(() => {
                    StreamReader sr = null;
                    sr             = File.OpenText(path);
                    string content = sr.ReadToEnd();
                    sr.Close();
                    m_localConfig = JsonFx.Json.JsonReader.Deserialize <VersionBundleConfig>(content);
                    if (null != onComplete)
                    {
                        Loom.QueueOnMainThread(() => {
                            onComplete();
                        });
                    }
                });
                yield break;
            }
        }
        catch (Exception error)
        {
            JZLog.LogError("VersionManager:Read - " + "Error: " + error.Message);
            if (null != onError)
            {
                onError();
            }
        }

        path = "file://" + PathUtils.MakeFilePath(GameConfig.LOCAL_CONFIG_FILE, PathUtils.PathType.MobileDiskStreamAssert);
        if (Application.platform == RuntimePlatform.Android)
        {
            path = "jar:" + path;
        }
        WWW www = new WWW(path);

        yield return(www);

        if (null != www && null == www.error)
        {
            JZLog.Log("load config success");
            string content = System.Text.Encoding.Default.GetString(www.bytes);
            Loom.RunAsync(() => {
                m_localConfig = JsonFx.Json.JsonReader.Deserialize <VersionBundleConfig>(content);
                if (null != onComplete)
                {
                    Loom.QueueOnMainThread(() =>
                    {
                        onComplete();
                    });
                }
            });
        }
        else
        {
            JZLog.LogError("VersionManager:Read - " + "Error: " + www.error);
            if (null != onError)
            {
                onError();
            }
        }
    }