热更新的dll项目想要继承主工程的类或者接口必须在主工程中写一个适配器
接口类的代码如下:
using System;
using Game.CocoRenderer;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using UnityEngine;
namespace ILRuntime.Adapters.GameAdaptor
{
public class CocoObjectAdaptor : CrossBindingAdaptor
{
public override Type BaseCLRType
{
get {
return typeof(ICocoObject); }
}
public override Type AdaptorType
{
get {
return typeof(Adaptor); }
}
public override object CreateCLRInstance(ILRuntime.Runtime.Enviorment.AppDomain appdomain,
ILTypeInstance instance)
{
return new Adaptor(appdomain, instance);
}
public class Adaptor : ICocoObject, CrossBindingAdaptorType
{
ILTypeInstance instance;
ILRuntime.Runtime.Enviorment.AppDomain appdomain;
public Adaptor( )
{
}
public Adaptor(ILRuntime.Runtime.Enviorment.AppDomain appdomain, ILTypeInstance instance)
{
this.appdomain = appdomain;
this.instance = instance;
}
public ILTypeInstance ILInstance
{
get