Optimized the speed of simulate build.
优化了编辑器下模拟构建的速度。
This commit is contained in:
@@ -13,9 +13,9 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑器下模拟运行的初始化操作
|
||||
/// 编辑器下模拟模式的初始化操作
|
||||
/// </summary>
|
||||
internal sealed class EditorPlayModeInitializationOperation : InitializationOperation
|
||||
internal sealed class EditorSimulateModeInitializationOperation : InitializationOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
@@ -24,10 +24,10 @@ namespace YooAsset
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly EditorPlayModeImpl _impl;
|
||||
private readonly EditorSimulateModeImpl _impl;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal EditorPlayModeInitializationOperation(EditorPlayModeImpl impl)
|
||||
internal EditorSimulateModeInitializationOperation(EditorSimulateModeImpl impl)
|
||||
{
|
||||
_impl = impl;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ namespace YooAsset
|
||||
{
|
||||
if (_steps == ESteps.Builder)
|
||||
{
|
||||
string manifestFilePath = EditorPlayModeHelper.DryRunBuild();
|
||||
string manifestFilePath = EditorSimulateModeHelper.SimulateBuild();
|
||||
if (string.IsNullOrEmpty(manifestFilePath))
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
@@ -65,7 +65,7 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 离线模式的初始化操作
|
||||
/// 离线运行模式的初始化操作
|
||||
/// </summary>
|
||||
internal sealed class OfflinePlayModeInitializationOperation : InitializationOperation
|
||||
{
|
||||
@@ -116,7 +116,7 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 网络模式的初始化操作
|
||||
/// 网络运行模式的初始化操作
|
||||
/// </summary>
|
||||
internal sealed class HostPlayModeInitializationOperation : InitializationOperation
|
||||
{
|
||||
|
||||
+7
-7
@@ -3,19 +3,19 @@ using System.Reflection;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
internal static class EditorPlayModeHelper
|
||||
internal static class EditorSimulateModeHelper
|
||||
{
|
||||
private static System.Type _classType;
|
||||
|
||||
public static string DryRunBuild()
|
||||
public static string SimulateBuild()
|
||||
{
|
||||
_classType = Assembly.Load("YooAsset.Editor").GetType("YooAsset.Editor.AssetBundleRuntimeBuilder");
|
||||
InvokePublicStaticMethod(_classType, "FastBuild");
|
||||
_classType = Assembly.Load("YooAsset.Editor").GetType("YooAsset.Editor.AssetBundleSimulateBuilder");
|
||||
InvokePublicStaticMethod(_classType, "SimulateBuild");
|
||||
return GetPatchManifestFilePath();
|
||||
}
|
||||
private static string GetPatchManifestFilePath()
|
||||
{
|
||||
return (string)InvokePublicStaticMethod(_classType, "GetPatchManifestFilePath");
|
||||
return (string)InvokePublicStaticMethod(_classType, "GetPatchManifestPath");
|
||||
}
|
||||
private static object InvokePublicStaticMethod(System.Type type, string method, params object[] parameters)
|
||||
{
|
||||
@@ -30,8 +30,8 @@ namespace YooAsset
|
||||
}
|
||||
}
|
||||
#else
|
||||
internal static class EditorPlayModeHelper
|
||||
internal static class EditorSimulateModeHelper
|
||||
{
|
||||
public static string DryRunBuild() { throw new System.Exception("Only support in unity editor !"); }
|
||||
public static string SimulateBuild() { throw new System.Exception("Only support in unity editor !"); }
|
||||
}
|
||||
#endif
|
||||
+2
-2
@@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
internal class EditorPlayModeImpl : IBundleServices
|
||||
internal class EditorSimulateModeImpl : IBundleServices
|
||||
{
|
||||
internal PatchManifest AppPatchManifest;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace YooAsset
|
||||
/// </summary>
|
||||
public InitializationOperation InitializeAsync()
|
||||
{
|
||||
var operation = new EditorPlayModeInitializationOperation(this);
|
||||
var operation = new EditorSimulateModeInitializationOperation(this);
|
||||
OperationSystem.ProcessOperaiton(operation);
|
||||
return operation;
|
||||
}
|
||||
Reference in New Issue
Block a user