Update runtime code
This commit is contained in:
@@ -3,20 +3,22 @@ using System.Reflection;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
internal static class EditorSimulateModeHelper
|
||||
public static class EditorSimulateModeHelper
|
||||
{
|
||||
private static System.Type _classType;
|
||||
|
||||
public static string SimulateBuild()
|
||||
/// <summary>
|
||||
/// 编辑器下模拟构建补丁清单
|
||||
/// </summary>
|
||||
public static string SimulateBuild(string packageName, bool enableAddressable)
|
||||
{
|
||||
_classType = Assembly.Load("YooAsset.Editor").GetType("YooAsset.Editor.AssetBundleSimulateBuilder");
|
||||
InvokePublicStaticMethod(_classType, "SimulateBuild");
|
||||
return GetPatchManifestFilePath();
|
||||
}
|
||||
private static string GetPatchManifestFilePath()
|
||||
{
|
||||
return (string)InvokePublicStaticMethod(_classType, "GetPatchManifestPath");
|
||||
if (_classType == null)
|
||||
_classType = Assembly.Load("YooAsset.Editor").GetType("YooAsset.Editor.AssetBundleSimulateBuilder");
|
||||
|
||||
string manifestFilePath = (string)InvokePublicStaticMethod(_classType, "SimulateBuild", packageName, enableAddressable);
|
||||
return manifestFilePath;
|
||||
}
|
||||
|
||||
private static object InvokePublicStaticMethod(System.Type type, string method, params object[] parameters)
|
||||
{
|
||||
var methodInfo = type.GetMethod(method, BindingFlags.Public | BindingFlags.Static);
|
||||
@@ -30,8 +32,14 @@ namespace YooAsset
|
||||
}
|
||||
}
|
||||
#else
|
||||
internal static class EditorSimulateModeHelper
|
||||
namespace YooAsset
|
||||
{
|
||||
public static class EditorSimulateModeHelper
|
||||
{
|
||||
public static string SimulateBuild() { throw new System.Exception("Only support in unity editor !"); }
|
||||
/// <summary>
|
||||
/// 编辑器下模拟构建补丁清单
|
||||
/// </summary>
|
||||
public static string SimulateBuild(string packageName, bool enableAddressable) { throw new System.Exception("Only support in unity editor !"); }
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user