From ef6717dfcfb32efb91ec1c8db7d0dc29bdbb04ea Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 01 十一月 2018 11:16:50 +0800
Subject: [PATCH] 3335 资源下载优先级别更新。
---
Assets/Editor/Tool/ClientPackage.cs | 21 +++++++++++++++------
Assets/Editor/Tool/ClientPackageExtension.cs | 1 +
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/Assets/Editor/Tool/ClientPackage.cs b/Assets/Editor/Tool/ClientPackage.cs
index 520d04b..f30872d 100644
--- a/Assets/Editor/Tool/ClientPackage.cs
+++ b/Assets/Editor/Tool/ClientPackage.cs
@@ -22,8 +22,13 @@
}
public static bool obfuscatorEnabled {
- get { return LocalSave.GetBool("obfuscatorEnabled",false); }
+ get { return LocalSave.GetBool("obfuscatorEnabled", false); }
set { LocalSave.SetBool("obfuscatorEnabled", value); }
+ }
+
+ public static int AssetPrior {
+ get { return LocalSave.GetInt("HalfAssetPrior", 1); }
+ set { LocalSave.SetInt("HalfAssetPrior", value); }
}
static string ANDROID_PLUGIN_PATH = Application.dataPath + "/Plugins/Android";
@@ -143,7 +148,8 @@
fileName = fileName.Replace(extersion, "");
}
- if (!PriorBundleConfig.mobs.Contains(fileName))
+ var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Mob, fileName);
+ if (prior > AssetPrior)
{
File.Delete(file.FullName);
}
@@ -160,7 +166,8 @@
fileName = fileName.Replace(extersion, "");
}
- if (!PriorBundleConfig.scenes.Contains(fileName))
+ var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Scene, fileName);
+ if (prior > AssetPrior)
{
File.Delete(file.FullName);
}
@@ -177,7 +184,8 @@
fileName = fileName.Replace(extersion, "");
}
- if (!PriorBundleConfig.audios.Contains(fileName))
+ var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Audio, fileName);
+ if (prior > AssetPrior)
{
File.Delete(file.FullName);
}
@@ -194,7 +202,8 @@
fileName = fileName.Replace(extersion, "");
}
- if (!PriorBundleConfig.effects.Contains(fileName))
+ var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Effect, fileName);
+ if (prior > AssetPrior)
{
File.Delete(file.FullName);
}
@@ -292,7 +301,7 @@
FileExtersion.DirectoryCopy(StringUtility.Contact(_sdkPath, "/ChannelDiff/Android/", versionConfig.appId), ANDROID_PLUGIN_PATH);
var option = AssetDatabase.LoadAssetAtPath<Options>("Assets/Editor/Beebyte/Obfuscator/ObfuscatorOptions.asset");
- if (option!=null)
+ if (option != null)
{
option.enabled = obfuscatorEnabled;
EditorUtility.SetDirty(option);
diff --git a/Assets/Editor/Tool/ClientPackageExtension.cs b/Assets/Editor/Tool/ClientPackageExtension.cs
index 99bca74..4dda5f2 100644
--- a/Assets/Editor/Tool/ClientPackageExtension.cs
+++ b/Assets/Editor/Tool/ClientPackageExtension.cs
@@ -16,6 +16,7 @@
try
{
Debug.LogFormat("浠庡懡浠よ涓В鏋愬嚭鏉ョ殑SDKPATH 鏄�:{0}", parameters.sdkPath);
+ ClientPackage.AssetPrior = 1;
ClientPackage.BuildPublishers(parameters.sdkPath, parameters.assetbundlePath, parameters.outputPath, parameters.publishers, parameters.buildIndex, false, false);
}
catch (Exception ex)
--
Gitblit v1.8.0