Support fast build mode.

支持快速构建模式,真实的实现EditorPlayMode的运行时环境。
This commit is contained in:
hevinci
2022-05-02 23:15:09 +08:00
parent 8d02406211
commit 665a16fe60
39 changed files with 492 additions and 383 deletions

View File

@@ -27,16 +27,17 @@ namespace YooAsset.Editor
var buildParameters = context.GetContextObject<AssetBundleBuilder.BuildParametersContext>();
var buildMapContext = context.GetContextObject<BuildMapContext>();
if (buildParameters.Parameters.DryRunBuild)
var buildMode = buildParameters.Parameters.BuildMode;
if (buildMode == EBuildMode.ForceRebuild || buildMode == EBuildMode.IncrementalBuild)
{
EncryptionContext encryptionContext = new EncryptionContext();
encryptionContext.EncryptList = new List<string>();
encryptionContext.EncryptList = EncryptFiles(buildParameters, buildMapContext);
context.SetContextObject(encryptionContext);
}
else
{
EncryptionContext encryptionContext = new EncryptionContext();
encryptionContext.EncryptList = EncryptFiles(buildParameters, buildMapContext);
encryptionContext.EncryptList = new List<string>();
context.SetContextObject(encryptionContext);
}
}
@@ -75,7 +76,7 @@ namespace YooAsset.Editor
{
byte[] bytes = encryptionServices.Encrypt(fileData);
File.WriteAllBytes(filePath, bytes);
UnityEngine.Debug.Log($"文件加密完成:{filePath}");
BuildRunner.Log($"文件加密完成:{filePath}");
}
}