Exemple #1
0
    private void RegisterILRuntimes(IXILRuntime appdomain)
    {
        appdomain.RegisterXComponent();
        appdomain.RegisterUIKit();

        appdomain.DelegateManager.RegisterMethodDelegate <Int32>();
        appdomain.DelegateManager.RegisterMethodDelegate <Int32, Int32>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int64>();
        appdomain.DelegateManager.RegisterMethodDelegate <TinaX.VFSKit.ISceneAsset, TinaX.XException>();

        appdomain.DelegateManager.RegisterMethodDelegate <UniRx.CollectionAddEvent <ILRuntime.Runtime.Intepreter.ILTypeInstance> >();

        appdomain.DelegateManager.RegisterFunctionDelegate <System.Int32, System.Boolean>();

        appdomain.DelegateManager.RegisterDelegateConvertor <TinaX.UIKit.DataBinding.BindableProperty <Int32> .ValueChangedDalegate>(act =>
        {
            return(new TinaX.UIKit.DataBinding.BindableProperty <Int32> .ValueChangedDalegate((oldValue, newValue) =>
            {
                ((Action <System.Int32, System.Int32>)act)(oldValue, newValue);
            }));
        });

        appdomain.DelegateManager.RegisterDelegateConvertor <UnityEngine.Events.UnityAction <System.Int32> >((act) =>
        {
            return(new UnityEngine.Events.UnityAction <System.Int32>((arg0) =>
            {
                ((Action <System.Int32>)act)(arg0);
            }));
        });
    }
Exemple #2
0
        public static IXILRuntime RegisterGameStage(this IXILRuntime xil)
        {
            //跨域继承适配器
            xil.RegisterCrossBindingAdaptor(new StageControllerBaseAdapter());

            //CLR重定向
            RedirectGameStage.Register(xil);

            return(xil);
        }
Exemple #3
0
        public static IXILRuntime RegisterUIKit(this IXILRuntime xil)
        {
            //跨域继承适配器
            xil.RegisterCrossBindingAdaptor(new XUIBehaviourAdaptors());

            //注册委托适配器
            xil.DelegateManager.RegisterMethodDelegate <IUIEntity, XException>();

            //CLR重定向
            RedirectUIKit.Register(xil);

            return(xil);
        }
        internal static void RegisterDelegates(IXILRuntime xil)
        {
            xil.DelegateManager.RegisterMethodDelegate <TinaX.Container.IServiceContainer>();
            xil.DelegateManager.RegisterMethodDelegate <UniRx.Unit>();
            xil.DelegateManager.RegisterMethodDelegate <System.Exception>();

            xil.DelegateManager.RegisterDelegateConvertor <UnityEngine.Events.UnityAction>((act) =>
            {
                return(new UnityEngine.Events.UnityAction(() =>
                {
                    ((Action)act)();
                }));
            });
        }
        public static void Register(IXILRuntime xil)
        {
            var methods = typeof(IUIKit).GetMethods();

            foreach (var method in methods)
            {
                var redirection = mapping.GetRedirection(method);
                if (redirection == null)
                {
                    continue;
                }

                xil.RegisterCLRMethodRedirection(method, redirection);
            }
        }
        private void RegisterILRuntimes(IXILRuntime xil)
        {
            xil.RegisterXComponent();
            xil.RegisterUIKit();

            xil.DelegateManager.RegisterMethodDelegate <Int32, Int32>();

            xil.DelegateManager.RegisterMethodDelegate <TinaX.VFSKit.ISceneAsset, TinaX.XException>();

            xil.DelegateManager.RegisterDelegateConvertor <TinaX.UIKit.DataBinding.BindableProperty <System.Int32> .ValueChangedDalegate>((act) =>
            {
                return(new TinaX.UIKit.DataBinding.BindableProperty <System.Int32> .ValueChangedDalegate((oldValue, newValue) =>
                {
                    ((Action <System.Int32, System.Int32>)act)(oldValue, newValue);
                }));
            });
        }
Exemple #7
0
        /// <summary>
        /// 注册CLR重定向
        /// </summary>
        /// <param name="appDomain">AppDomain</param>
        public static void Register(IXILRuntime xil)
        {
            foreach (var item in m_Mappings)
            {
                var mapping = item.Value;
                var type    = item.Key;
                var methods = type.GetMethods();

                foreach (var method in methods)
                {
                    var redirection = mapping.GetRedirection(method);
                    if (redirection == null)
                    {
                        continue;
                    }

                    xil.RegisterCLRMethodRedirection(method, redirection);
                }
            }
        }
 public static IXILRuntime RegisterXComponent(this IXILRuntime xil)
 {
     xil.RegisterCrossBindingAdaptor(new XBehaviourAdaptor());
     return(xil);
 }
 internal static void RegisterCrossBindingAdaptors(IXILRuntime xil)
 {
     xil.RegisterCrossBindingAdaptor(new IAsyncStateMachineClassInheritanceAdaptor()); //用于Async/await
 }
 internal static void RegisterCLRMethodRedirections(IXILRuntime xil)
 {
     //CLR重定向
     Redirect.RedirectXIL.Register(xil);
     LitJson.JsonMapper.RegisterILRuntimeCLRRedirection(xil.ILRuntimeAppDomain);
 }