少年修仙传客户端基础资源
lwb
2021-03-09 da6274c5876960712c91ed854adb20c90b3d47f4
9527 增加一个跨域适配器

(cherry picked from commit 9a2be3861c9210787e932899945540550e100940)
2个文件已修改
2个文件已添加
85 ■■■■■ 已修改文件
Assets/ILRuntime/Editor/ILRuntimeCrossBinding.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/ILRuntime/Src/ILBehaviourProxy.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/ILRuntime/Src/Inheritance/IConfigPostProcessAdapter.cs 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/ILRuntime/Src/Inheritance/IConfigPostProcessAdapter.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/ILRuntime/Editor/ILRuntimeCrossBinding.cs
@@ -11,7 +11,7 @@
        EditorWindow.GetWindow<ILRuntimeCrossBinding>("生成跨域继承适配器").Show();
    }
    Type type = typeof(Snxxz.UI.OperationBase);
    Type type = typeof(IConfigPostProcess);
    private void OnGUI()
    {
Assets/ILRuntime/Src/ILBehaviourProxy.cs
@@ -14,8 +14,7 @@
    [Tooltip("Logic工程的代码,例:命名空间.类名")]
    List<string> classNames;
    Dictionary<string, ILBehaviourHolder> ilBehaviourHolders = new Dictionary<string, ILBehaviourHolder>();
    AppDomain appDomain
    {
    AppDomain appDomain {
        get { return ILLauncherProxy.Instance.appdomain; }
    }
Assets/ILRuntime/Src/Inheritance/IConfigPostProcessAdapter.cs
New file
@@ -0,0 +1,69 @@
using System;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
namespace ILCrossBinding
{
    public class IConfigPostProcessAdapter : CrossBindingAdaptor
    {
        static CrossBindingMethodInfo mOnConfigParseCompleted_0 = new CrossBindingMethodInfo("OnConfigParseCompleted");
        public override Type BaseCLRType
        {
            get
            {
                return typeof(global::IConfigPostProcess);
            }
        }
        public override Type AdaptorType
        {
            get
            {
                return typeof(Adapter);
            }
        }
        public override object CreateCLRInstance(ILRuntime.Runtime.Enviorment.AppDomain appdomain, ILTypeInstance instance)
        {
            return new Adapter(appdomain, instance);
        }
        public class Adapter : global::IConfigPostProcess, CrossBindingAdaptorType
        {
            ILTypeInstance instance;
            ILRuntime.Runtime.Enviorment.AppDomain appdomain;
            public Adapter()
            {
            }
            public Adapter(ILRuntime.Runtime.Enviorment.AppDomain appdomain, ILTypeInstance instance)
            {
                this.appdomain = appdomain;
                this.instance = instance;
            }
            public ILTypeInstance ILInstance { get { return instance; } }
            public void OnConfigParseCompleted()
            {
                mOnConfigParseCompleted_0.Invoke(this.instance);
            }
            public override string ToString()
            {
                IMethod m = appdomain.ObjectType.GetMethod("ToString", 0);
                m = instance.Type.GetVirtualMethod(m);
                if (m == null || m is ILMethod)
                {
                    return instance.ToString();
                }
                else
                    return instance.Type.FullName;
            }
        }
    }
}
Assets/ILRuntime/Src/Inheritance/IConfigPostProcessAdapter.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c5967f89ca472ae40b1417d5a69a7169
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant: