Update runtime code

This commit is contained in:
hevinci
2022-09-29 18:40:43 +08:00
parent 46c219505f
commit a71921cdd1
36 changed files with 844 additions and 1625 deletions
@@ -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