少年修仙传客户端代码仓库
client_Wu Xijin
2018-11-16 298ea0c21c797dbda66deecf8b513297f0fa82ea
3335 更新客户端解压逻辑
2个文件已修改
57 ■■■■ 已修改文件
Core/GameEngine/Login/Launch.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Launch/AssetDeCompressTask.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Login/Launch.cs
@@ -13,9 +13,11 @@
    static public LaunchStage currentStage { get { return m_CurrentStage; } }
    static float m_Progress = 0f;
    static public float progress {
    static public float progress
    {
        get { return m_Progress; }
        set {
        set
        {
            if (m_Progress != value)
            {
                m_Progress = value;
@@ -195,7 +197,10 @@
                        progress = Mathf.Clamp(progressBuf + timer / duration * 0.3f, progressBuf, progressBuf + 0.3f);
                        yield return null;
                    }
                }
                if (!AssetDeCompressTask.assetDeCompressCompleted)
                {
                    progressBuf = progress;
                    var decompressProgress = AssetDeCompressTask.DecompressAync(ResourcesPath.Instance.ExternalStorePath);
                    while (!decompressProgress.done)
@@ -203,6 +208,8 @@
                        progress = progressBuf + decompressProgress.progress * 0.1f;
                        yield return null;
                    }
                    AssetDeCompressTask.assetDeCompressVersion = VersionConfig.Get().version;
                }
                break;
            case InstalledAsset.NullAsset:
System/Launch/AssetDeCompressTask.cs
@@ -7,6 +7,34 @@
public class AssetDeCompressTask
{
    public static string assetDeCompressVersion
    {
        get
        {
            return LocalSave.GetString("AssetDeCompressVersion");
        }
        set
        {
            LocalSave.SetString("AssetDeCompressVersion", value);
        }
    }
    public static bool assetDeCompressCompleted
    {
        get
        {
            if (string.IsNullOrEmpty(assetDeCompressVersion))
            {
                return false;
            }
            else
            {
                return assetDeCompressVersion == VersionConfig.Get().version;
            }
        }
    }
    public static void Decompress(string path)
    {
        var files = new List<FileInfo>();
@@ -83,11 +111,14 @@
    {
        object progressLock = new object();
        float m_Progress = 0f;
        public float progress {
            get {
        public float progress
        {
            get
            {
                return m_Progress;
            }
            set {
            set
            {
                lock (progressLock)
                {
                    m_Progress = value;
@@ -97,11 +128,14 @@
        object doneLock = new object();
        bool m_Done = false;
        public bool done {
            get {
        public bool done
        {
            get
            {
                return m_Done;
            }
            set {
            set
            {
                lock (doneLock)
                {
                    m_Done = value;