Пример #1
0
    void InitializeILRuntime()
    {
        //初始化CLR绑定,让DLL里面的调用更快
        ILRuntime.Runtime.Generated.CLRBindings.Initialize(mAppDomain);
        //注册LitJson到DLL
        LitJson.JsonMapper.RegisterILRuntimeCLRRedirection(mAppDomain);
        //注册一些类到DLL
        ColliderListener.RegisterILRuntime(mAppDomain);
        U3DUtility.TcpLayer.RegisterILRuntime(mAppDomain);

        //注册MonoBehaviour到DLL
        mAppDomain.RegisterCrossBindingAdaptor(new MonoBehaviourAdapter());
        //注册协程到DLL
        mAppDomain.RegisterCrossBindingAdaptor(new CoroutineAdapter());
        //注册Protobuf
        mAppDomain.DelegateManager.RegisterFunctionDelegate <Adapt_IMessage.Adaptor>();
        mAppDomain.RegisterCrossBindingAdaptor(new Adapt_IMessage());
    }