예제 #1
0
 protected virtual IEnumerator InitalizeWait(Config config)
 {
     while (!HotfixILRManager.GetInstance().IsInit)
     {
         yield return(null);
     }
 }
예제 #2
0
    /// <summary>
    /// Call ILR的带instance的class的方法
    /// </summary>
    /// <param name="hotfixClassPath"></param>
    /// <param name="instance"></param>
    /// <param name="methodName"></param>
    /// <param name="p"></param>
    /// <returns></returns>
    public static object CallStaticHotfixEx(string hotfixClassPath, string instance, string methodName, params object[] p)
    {
        if (!Application.isPlaying)
        {
            return(null);
        }

        if (!HotfixILRManager.GetInstance().IsInit)
        {
            return(null);
        }

#if ILRuntime
        IType        type     = HotfixILRManager.GetInstance().appdomain.LoadedTypes[hotfixClassPath];
        PropertyInfo property = type.ReflectionType.GetProperty(instance);
        object       obj      = property.GetValue(null);
        if (obj == null)
        {
            return(null);
        }
        IMethod m = type.GetMethod(methodName, p.Length);
        return(HotfixILRManager.GetInstance().appdomain.Invoke(m, obj, p));
#else
        return(UseMonoReflectOneRes(hotfixClassPath, instance, methodName, p));
#endif
    }
예제 #3
0
    /// <summary>
    /// 初始化ILR,可主动调用
    /// </summary>
    public void ILRObjInit()
    {
        if (ilinstance == null && !string.IsNullOrEmpty(hotfixClassPath))
        {
#if ILRuntime
            ilinstance = HotfixILRManager.GetInstance().appdomain.Instantiate <UIControllerILRObject>(hotfixClassPath);
#else
            var type = HotfixILRManager.GetInstance().assembly.GetType(hotfixClassPath);
            ilinstance = System.Activator.CreateInstance(type) as UIControllerILRObject;
#endif

            ilinstance.SetUIController(this);

            BindingParam();

            base.Awake();
            if (ilinstance != null)
            {
                ilinstance.Awake();

                if (IsFixShader)
                {
                    //修正Shader
                    GM.AssetUtils.FixShaderInEditor(this);
                }
            }
        }
    }
예제 #4
0
    void Update()
    {
        if (_assembly == null)
        {
            _assembly = HotfixILRManager.GetInstance().assembly;
        }
        if (_assembly == null)
        {
            return;
        }

        #region GuideManager
        //记录服务器收到数据情况
        isReceiveGuideNodes    = (bool)MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "isReceiveGuideNodes");
        isReceiveCompletedData = (bool)MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "isReceiveCompletedData");
        //-----
        IsGuide                 = (bool)MonoGetStaticProperty("Hotfix_LT.UI.GuideNodeManager", "IsGuide");
        IsRunGuide              = (bool)MonoGetStaticProperty("Hotfix_LT.UI.GuideNodeManager", "IsRunGuide");
        isFirstCombatGuide      = (bool)MonoGetStaticMethod("Hotfix_LT.UI.GuideNodeManager", "isFirstCombatGuide");
        combatLimitClick        = (bool)MonoGetStaticProperty("Hotfix_LT.UI.GuideNodeManager", "combatLimitClick");
        IsVirtualBtnGuide       = (bool)MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "IsVirtualBtnGuide");
        VirtualBtnStr           = MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "VirtualBtnStr") as string;
        isFuncOpenGuide         = (bool)MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "isFuncOpenGuide");
        FuncOpenGuideId         = MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "FuncOpenGuideId") as string;
        GateString              = MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "GateString") as string;
        partnerStatID           = (int)MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "partnerStatID");
        currentGuideId          = (int)MonoGetStaticProperty("Hotfix_LT.UI.GuideNodeManager", "currentGuideId");
        listCompleteFirstStepID = (List <int>)MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "listCompleteFirstStepID");
        //----
        _startTime        = (float)MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "_startTime");
        _serverSaveStr    = MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "_serverSaveStr") as string;
        _beforeMemoryTime = (float)MonoGetStaticField("Hotfix_LT.UI.GuideNodeManager", "_beforeMemoryTime");

        #endregion
    }
예제 #5
0
    static void InitILRuntime(ILRuntime.Runtime.Enviorment.AppDomain domain)
    {
        //这里需要注册所有热更DLL中用到的跨域继承Adapter,否则无法正确抓取引用
        //domain.RegisterCrossBindingAdaptor(new CoroutineAdapter());
        //domain.RegisterCrossBindingAdaptor(new DynamicMonoILRObjectAdaptor());
        //domain.RegisterCrossBindingAdaptor(new LogicILRObjectAdaptor());
        //domain.RegisterCrossBindingAdaptor(new MonoBehaviourAdapter());
        //domain.RegisterCrossBindingAdaptor(new NodeDataILRObjectAdaptor());
        //domain.RegisterCrossBindingAdaptor(new UIControllerILRObjectAdapter());
        //domain.RegisterCrossBindingAdaptor(new DataLookupILRObjectAdapter());
        //domain.RegisterCrossBindingAdaptor(new SparxAPIAdapter());


        HotfixILRManager.RegisterCrossBindingAdaptor(domain);
        // domain.RegisterCrossBindingAdaptor(new MonoBehaviourAdapter());
        // domain.RegisterCrossBindingAdaptor(new CoroutineAdapter());
        // domain.RegisterCrossBindingAdaptor(new UIControllerILRObjectAdapter());
        // domain.RegisterCrossBindingAdaptor(new LogicILRObjectAdaptor());
        // domain.RegisterCrossBindingAdaptor(new DynamicMonoILRObjectAdaptor());
        // domain.RegisterCrossBindingAdaptor(new DataLookupILRObjectAdapter());
        // domain.RegisterCrossBindingAdaptor(new SparxAPIAdapter());
        // domain.RegisterCrossBindingAdaptor(new GameEventAdapter());
        // domain.RegisterCrossBindingAdaptor(new IComparableAdapter());
        // domain.RegisterCrossBindingAdaptor(new IComparerAdapter());
        // domain.RegisterCrossBindingAdaptor(new IEqualityComparerAdapter());
        // domain.RegisterCrossBindingAdaptor(new TableAdapter());
        // domain.RegisterCrossBindingAdaptor(new EventNameAdapter());
    }
예제 #6
0
 public static HotfixILRManager GetInstance()
 {
     if (_instance == null)
     {
         EB.Debug.Log("Creat HotfixILRManager Instance.");
         GameObject go = new GameObject("HotfixILRManager");
         DontDestroyOnLoad(go);
         _instance = go.AddComponent <HotfixILRManager>();
     }
     return(_instance);
 }
예제 #7
0
    protected override IEnumerator InitalizeWait(Config config)
    {
        yield return(base.InitalizeWait(config));

        string Core = "Hotfix_LT.UI.LTHotfixManager";

#if ILRuntime
        logicObject = HotfixILRManager.GetInstance().appdomain.Instantiate <LogicILRObject>(Core);
#else
        var type = HotfixILRManager.GetInstance().assembly.GetType(Core);
        logicObject = System.Activator.CreateInstance(type) as LogicILRObject;
#endif

        logicObject.Initialize(config);
    }
예제 #8
0
    static void GenerateCLRBindingByAnalysis()
    {
        //用新的分析热更dll调用引用来生成绑定代码
        ILRuntime.Runtime.Enviorment.AppDomain domain = new ILRuntime.Runtime.Enviorment.AppDomain();
        using (System.IO.FileStream fs = new System.IO.FileStream("Library/ScriptAssemblies/Unity_Hotfix.dll", System.IO.FileMode.Open, System.IO.FileAccess.Read))
        {
            domain.LoadAssembly(fs);
            // InitILRuntime(domain);
            HotfixILRManager.InitializeILRuntime(domain);

            // List<Type> types = new List<Type>();
            // types.Add(typeof(Quaternion));
            // types.Add(typeof(Vector2));
            // types.Add(typeof(Vector3));

            ILRuntime.Runtime.CLRBinding.BindingCodeGenerator.GenerateBindingCode(domain, "Assets/_GameAssets/Scripts/Game/ILR/Generated");
        }
        //Crossbind Adapter is needed to generate the correct binding code
    }
예제 #9
0
    /// <summary>
    /// Call ILR的静态方法
    /// </summary>
    /// <param name="hotfixClassPath"></param>
    /// <param name="methodName"></param>
    /// <param name="p"></param>
    /// <returns></returns>
    public static object CallStaticHotfix(string type, string method, params object[] p)
    {
        if (!Application.isPlaying)
        {
            return(null);
        }

        if (!HotfixILRManager.GetInstance().IsInit)
        {
            return(null);
        }

#if ILRuntime
        return(GetHotfixMthod.Instance.InvokeHotfixMethod(type, null, method, p));
#else
        var t = HotfixILRManager.GetInstance().assembly.GetType(type);
        return(t.GetMethod(method).Invoke(null, p));
#endif
    }
예제 #10
0
    //mono调用反射返回1个值
    private static object UseMonoReflectOneRes(string hotfixClassPath, string instance, string methodName, object[] ilParams)
    {
#if !ILRuntime
        Type         type     = HotfixILRManager.GetInstance().assembly.GetType(hotfixClassPath);
        PropertyInfo property = type.GetProperty(instance);
        object       obj      = property.GetValue(null);

        if (obj != null)
        {
            return(type.GetMethod(methodName).Invoke(obj, ilParams));
        }
        else
        {
            return(null);
        }
#else
        return(null);
#endif
    }
예제 #11
0
    public void ILRObjInit()
    {
        if (dlinstance == null && !string.IsNullOrEmpty(hotfixClassPath))
        {
#if ILRuntime
            dlinstance = HotfixILRManager.GetInstance().appdomain.Instantiate <DataLookILRObject>(hotfixClassPath);
#else
            var type = HotfixILRManager.GetInstance().assembly.GetType(hotfixClassPath);
            dlinstance = System.Activator.CreateInstance(type) as DataLookILRObject;
#endif
            dlinstance.SetDataLookup(this);

            base.Awake();
            if (dlinstance != null)
            {
                dlinstance.Awake();
            }
        }
    }
예제 #12
0
    /// <summary>
    /// 初始化ILR,可主动调用
    /// </summary>
    public void ILRObjInit()
    {
        if (_ilrObject == null && !string.IsNullOrEmpty(hotfixClassPath))
        {
#if ILRuntime
            _ilrObject = HotfixILRManager.GetInstance().appdomain.Instantiate <DynamicMonoILRObject>(hotfixClassPath);
#else
            var type = HotfixILRManager.GetInstance().assembly.GetType(hotfixClassPath);
            //UnityEngine.Debug.LogError("type :"+ type.Name);
            _ilrObject = System.Activator.CreateInstance(type) as DynamicMonoILRObject;
#endif

            _ilrObject.SetMono(this);

            if (_ilrObject != null)
            {
                _ilrObject.Awake();
            }
        }
    }
예제 #13
0
        public static void CallFixedUpdateMono()
        {
            if (!mCallFixedUpdateMono_Got)
            {
#if ILRuntime
                var iType = HotfixILRManager.GetInstance().appdomain?.GetType(mType);
                mCallFixedUpdateMono = iType?.GetMethod("FixedUpdate", 0);
#else
                var t = HotfixILRManager.GetInstance().assembly?.GetType(mType);
                mCallFixedUpdateMono = t?.GetMethod("FixedUpdate");
#endif
                mCallFixedUpdateMono_Got = mCallFixedUpdateMono != null;
            }
#if ILRuntime
            HotfixILRManager.GetInstance().appdomain.Invoke(mCallFixedUpdateMono, null, null);
#else
            mCallFixedUpdateMono?.Invoke(null, callFixedUpdateMonoParameters);
#endif
            // GlobalUtils.CallStaticHotfix("Hotfix_LT.ILRUpdateManager", "FixedUpdate", ilrObject);
        }
예제 #14
0
    /// <summary>
    /// 调用热更方法(可缓存方法)
    /// </summary>
    /// <param name="TypeName">类型名</param>
    /// <param name="MethodName">方法名</param>
    /// <param name="parmType">参数类型数组,无则为null</param>
    /// <param name="instance">实例,静态方法为null</param>
    /// <param name="param">参数数组,无参数null</param>
    /// <returns></returns>
    public object InvokeHotfixMethod(string TypeName, string InstanceName, string MethodName, params object[] param)
    {
        object instance = null;

        if (!string.IsNullOrEmpty(InstanceName))
        {
            instance = GetHotfixTypeAttribute(TypeName, InstanceName, null);
        }

        int   parmNum = 0;
        IType itype   = GetHotfixType(TypeName);

        if (itype == null)
        {
            return(null);
        }

        Dictionary <string, IMethod> methodDic;
        IMethod Method;

        if (!IMethodDic.TryGetValue(TypeName, out methodDic) ||
            !methodDic.TryGetValue(MethodName, out Method))
        {
            parmNum = param == null? 0 : param.Length;
            Method  = itype.GetMethod(MethodName, parmNum);
            if (Method == null)
            {
                EB.Debug.LogError("Can not find Hotfix IMethod: {0}:{1}", TypeName, MethodName);
                return(null);
            }

            if (methodDic == null)
            {
                methodDic            = new Dictionary <string, IMethod>();
                IMethodDic[TypeName] = methodDic;
            }
            methodDic[MethodName] = Method;
        }
        obj = HotfixILRManager.GetInstance().appdomain.Invoke(Method, instance, param);
        return(obj);
    }
예제 #15
0
    private IType GetHotfixType(string TypeName)
    {
        if (!HotfixILRManager.GetInstance().IsInit)
        {
            return(null);
        }
        IType itype;

        if (!ITypeDic.TryGetValue(TypeName, out itype))
        {
            itype = HotfixILRManager.GetInstance().appdomain.GetType(TypeName);
            if (itype == null)
            {
                EB.Debug.LogError("Can not find Hotfix Itype: {0}", TypeName);
                return(null);
            }
            ITypeDic[TypeName] = itype;
        }

        return(itype);
    }
예제 #16
0
    public static bool GetHotfixToIntGetBool(string hotfixClassPath, string instance, string methodName, int param)
    {
#if ILRuntime
        IType        type     = HotfixILRManager.GetInstance().appdomain.LoadedTypes[hotfixClassPath];
        Type         t        = type.ReflectionType;
        PropertyInfo property = t.GetProperty(instance);
        object       obj      = property.GetValue(null);

        IMethod m = type.GetMethod(methodName, 1);
        using (var ctx = HotfixILRManager.GetInstance().appdomain.BeginInvoke(m))
        {
            ctx.PushObject(obj);
            ctx.PushObject(param);
            ctx.Invoke();

            return(ctx.ReadBool());
        }
#else
        return((bool)UseMonoReflectOneRes(hotfixClassPath, instance, methodName, new object[] { param }));
#endif
    }
예제 #17
0
    //参数是string,返回也string,可以直接用上面的变长参数
    public static string GetTemplateToStringGetString(string hotfixClassPath, string instance, string methodName, string economyid)
    {
#if ILRuntime
        IType        type     = HotfixILRManager.GetInstance().appdomain.LoadedTypes[hotfixClassPath];
        Type         t        = type.ReflectionType;
        PropertyInfo property = t.GetProperty(instance);
        object       obj      = property.GetValue(null);

        IMethod m = type.GetMethod(methodName, 1);
        using (var ctx = HotfixILRManager.GetInstance().appdomain.BeginInvoke(m))
        {
            ctx.PushObject(obj);
            ctx.PushObject(economyid);
            ctx.Invoke();

            return(ctx.ReadObject <string>());
        }
#else
        return((string)UseMonoReflectOneRes(hotfixClassPath, instance, methodName, new object[] { economyid }));
#endif
    }
예제 #18
0
        public static void UnRegisterNeedUpdateMono(IUpdateable ilrObject)
        {
            if (!mUnRegisterNeedUpdateMono_Got)
            {
#if ILRuntime
                var iType = HotfixILRManager.GetInstance().appdomain.GetType(mType);
                mUnRegisterNeedUpdateMono = iType.GetMethod("UnRegisterNeedUpdateMono", 1);
#else
                var t = HotfixILRManager.GetInstance().assembly?.GetType(mType);
                mUnRegisterNeedUpdateMono = t?.GetMethod("UnRegisterNeedUpdateMono");
#endif

                mUnRegisterNeedUpdateMono_Got = mUnRegisterNeedUpdateMono != null;
            }
#if ILRuntime
            HotfixILRManager.GetInstance().appdomain.Invoke(mUnRegisterNeedUpdateMono, null, ilrObject);
#else
            unParameters[0] = ilrObject;
            mUnRegisterNeedUpdateMono?.Invoke(null, unParameters);
#endif
            // GlobalUtils.CallStaticHotfix("Hotfix_LT.ILRUpdateManager", "UnRegisterNeedUpdateMono", ilrObject);
        }
예제 #19
0
    public Type GetHotfixType(string TypeName)
    {
        if (!HotfixILRManager.GetInstance().IsInit)
        {
            return(null);
        }

        if (TypeDic.ContainsKey(TypeName))
        {
            type = TypeDic[TypeName];
        }
        else
        {
            type = HotfixILRManager.GetInstance().assembly.GetType(TypeName);
            if (type == null)
            {
                EB.Debug.LogError("Can not find Hotfix type:" + TypeName);
                return(null);
            }
            TypeDic.Add(TypeName, type);
        }
        return(type);
    }
예제 #20
0
    void OnApplicationFocus(bool focusStatus)
    {
        // first called after Awake
        //EB.Debug.Log("GameEngine.OnApplicationFocus: status = {0}", focusStatus);

        GameStateManager.Instance.OnFocus(focusStatus);
        if (GameStateManager.Instance.State >= eGameState.Login)
        {
            SparxHub.Instance.OnFocus(focusStatus);
        }
        bool isSceneLoop = false;

        if (HotfixILRManager.GetInstance().IsInit)
        {
            isSceneLoop = (bool)GlobalUtils.CallStaticHotfix("Hotfix_LT.UI.SceneLogic", "isSceneLoop");
        }
        if (isSceneLoop /*isSceneLoop*//*SceneLogic.SceneState == SceneLogic.eSceneState.SceneLoop*/)
        {
            if (PerformanceManager.Instance.CurrentEnvironmentInfo.slowDevice)
            {
                //setDesignContentScale(1334,750);
            }
        }
    }
예제 #21
0
        /// <summary>
        /// 加载预制完成的回调
        /// </summary>
        /// <param name="assetname"></param>
        /// <param name="go"></param>
        /// <param name="successed"></param>
        protected virtual void OnAssetReady(string assetName, GameObject go, bool succ)
        {
            try
            {
                if (!succ)
                {
                    //如果不成功 go 是null
                    mLoading = false;
                    EB.Debug.LogError("MenuCreater.OnAssetReady: load {0} failed", go.ToString());

                    if (mOnReady != null)
                    {
                        mOnReady(null);
                        mOnReady = null;
                    }
                    return;
                }

                GlobalMenuManager.Instance.OpenUIPrefabEnd(menuPrefabName);

                if (!mLoading)
                {
                    GameObject.Destroy(go);

                    if (mOnReady != null)
                    {
                        mOnReady(null);
                        mOnReady = null;
                    }
                    return;
                }

                PloadData data;
                data.AssetName = menuPrefabName;
                data.Go        = go;

                if (!string.IsNullOrEmpty(hotfixClassPath))
                {
                    //EB.Coroutines.Run(Process(true, menuPrefabName, go));

                    if (HotfixILRManager.GetInstance().IsInit)
                    {
                        data.IsHotfix = true;
                        OnPloadProcess(data);
                    }
                    else
                    {
                        if (m_IsManagerReadedHandler == 0)
                        {
                            m_IsManagerReadedHandler = ILRTimerManager.instance.AddTimer(50, int.MaxValue,
                                                                                         delegate(int sequence)
                            {
                                if (HotfixILRManager.GetInstance().IsInit)
                                {
                                    ILRTimerManager.instance.RemoveTimer(m_IsManagerReadedHandler);
                                    m_IsManagerReadedHandler = 0;

                                    data.IsHotfix = true;
                                    OnPloadProcess(data);
                                }
                            }
                                                                                         );
                        }
                    }
                }
                else
                {
                    //EB.Coroutines.Run(Process(false, menuPrefabName, go));

                    data.IsHotfix = false;
                    OnPloadProcess(data);
                }
            }
            catch (System.NullReferenceException e)
            {
                EB.Debug.LogError(e.ToString());
            }
        }
예제 #22
0
    public static void AutoBinding()
    {
#if !ILRuntime
        UIControllerILR current = UnityEditor.Selection.activeGameObject.GetComponent <UIControllerILR>();

        UIControllerILRObject instance = current.ilinstance;
        bool release = false;
        if (!string.IsNullOrEmpty(current.hotfixClassPath))
        {
            var type = HotfixILRManager.GetInstance().assembly.GetType(current.hotfixClassPath);
            if (instance == null)
            {
                instance = System.Activator.CreateInstance(type) as UIControllerILRObject;
                release  = true;
            }

            FieldInfo[] fields = type.GetFields();
            TextAsset   script = AssetDatabase.LoadAssetAtPath <TextAsset>(string.Concat("Assets/", current.FilePath));
            if (script == null || script.text == String.Empty)
            {
                Debug.LogError("Could not read text by " + string.Concat("Assets/", current.FilePath));
                return;
            }

            string[] rows      = script.text.Split(new string[] { "\n" }, StringSplitOptions.None);
            string   targetRow = string.Empty;

            foreach (FieldInfo f in fields)
            {
                System.Type fieldType = f.FieldType;
                Debug.LogFormat("field.Name = {0},field.Type.Name = {1}", f.Name, fieldType.Name);
                UIControllerILR.ParmType fieldEnumType;
                if (System.Enum.TryParse(fieldType.Name, out fieldEnumType))
                {
                    if (!current.ParmPathList.Exists(p => p.Name == f.Name))
                    {
                        UIControllerILR.ParmStruct structural = new UIControllerILR.ParmStruct();
                        structural.Name = f.Name;
                        structural.Type = fieldEnumType;

                        for (int i = 0; i < rows.Length; i++)
                        {
                            string row = rows[i];
                            if (row.Contains(f.Name + " = t.") || row.Contains(f.Name + " = controller.transform."))
                            {
                                targetRow = row;
                                break;
                            }
                        }
                        if (string.IsNullOrEmpty(targetRow))
                        {
                            Debug.Log("<color=yellow>this filed has not found or got by awake method!</color>"); continue;
                        }

                        string[] parts = targetRow.TrimAll('"').Split('(');
                        if (parts.Length > 1)
                        {
                            string text = parts[1].TrimAll('(', ')', ';', '.').Replace("gameObject", String.Empty).TrimEnd();
                            if (!string.IsNullOrEmpty(text))
                            {
                                structural.Path = text.Replace(String.Format("GetComponent<{0}>", structural.Type.ToString()), "");
                            }
                            Debug.LogFormat("Create ParmStruct: <color=purple>Name = {0},Type = {1},Path = {2}</color>", structural.Name, structural.Type, structural.Path);
                        }

                        current.ParmPathList.Add(structural);
                        EditorUtility.SetDirty(current);
                    }
                }
                else
                {
                    Debug.Log("<color=red>field type is not feasible!</color>");
                }
            }
        }

        if (release)
        {
            instance = null;
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
        }
#else
        EB.Debug.LogError("ILR模式下不存在assembly,会报错!请自行解决后再去掉这个宏。");
#endif
    }
예제 #23
0
 protected void Awake()
 {
     IsInit    = false;
     _instance = this;
     //EB.Coroutines.Run(StartProcess());
 }
예제 #24
0
    public static void InitializeILRuntime(ILRuntime.Runtime.Enviorment.AppDomain appdomain)
    {
        //这里做一些ILRuntime的注册
        //RegisterCrossBindingAdaptor
        HotfixILRManager.RegisterCrossBindingAdaptor(appdomain);


        // value type register

        appdomain.RegisterValueTypeBinder(typeof(UnityEngine.Vector2), new Vector2Binder());
        appdomain.RegisterValueTypeBinder(typeof(UnityEngine.Vector3), new Vector3Binder());
        appdomain.RegisterValueTypeBinder(typeof(UnityEngine.Quaternion), new QuaternionBinder());


        //DelegateManager.RegisterMethodDelegate
        appdomain.DelegateManager.RegisterMethodDelegate <Hashtable>();
        appdomain.DelegateManager.RegisterMethodDelegate <int[]>();
        appdomain.DelegateManager.RegisterMethodDelegate <bool>();
        appdomain.DelegateManager.RegisterMethodDelegate <string, string>();
        appdomain.DelegateManager.RegisterMethodDelegate <string, int>();
        appdomain.DelegateManager.RegisterMethodDelegate <string, int, int>();
        appdomain.DelegateManager.RegisterMethodDelegate <GameObject>();
        appdomain.DelegateManager.RegisterMethodDelegate <Transform>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int32>();
        appdomain.DelegateManager.RegisterMethodDelegate <GameEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Boolean>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Collections.Generic.KeyValuePair <UIEventTrigger, System.Int32> >();
        appdomain.DelegateManager.RegisterMethodDelegate <ILRuntime.Runtime.Intepreter.ILTypeInstance>();
        appdomain.DelegateManager.RegisterMethodDelegate <UnityEngine.Object, System.Object>();
        appdomain.DelegateManager.RegisterMethodDelegate <EB.Sparx.ChatMessage[]>();
        appdomain.DelegateManager.RegisterMethodDelegate <UnityEngine.GameObject, UnityEngine.Vector2>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Collections.Generic.List <EB.Sparx.ChatMessage> >();
        appdomain.DelegateManager.RegisterMethodDelegate <UnityEngine.GameObject, System.Boolean>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int64>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.String>();
        appdomain.DelegateManager.RegisterMethodDelegate <UIPanel>();
        appdomain.DelegateManager.RegisterMethodDelegate <UnityEngine.Texture>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int32, System.Object>();
        appdomain.DelegateManager.RegisterMethodDelegate <EB.Sparx.Response>();
        appdomain.DelegateManager.RegisterMethodDelegate <DynamicMonoILRObjectAdaptor.Adaptor>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.String, System.String, System.String, System.String>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.String, System.Object>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Object>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.String, System.Int32>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int32, System.Boolean>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int64, System.Action <System.Int64> >();
        appdomain.DelegateManager.RegisterMethodDelegate <EB.Sparx.LevelRewardsStatus>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Boolean, System.Boolean>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.String, System.Object, System.Boolean>();
        appdomain.DelegateManager.RegisterMethodDelegate <string, object, bool>();
        appdomain.DelegateManager.RegisterMethodDelegate <ILRuntime.Runtime.Intepreter.ILTypeInstance, UnityEngine.Transform>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Action>();
        appdomain.DelegateManager.RegisterMethodDelegate <EB.IAP.Item, EB.IAP.Transaction>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int32, System.Action <EB.Sparx.Response> >();
        appdomain.DelegateManager.RegisterMethodDelegate <ILRuntime.Runtime.GeneratedAdapter.GameEventAdapter.Adapter>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int64, System.Int32>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int64, System.Int64>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.String, System.Collections.Hashtable>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int32, System.Int32>();
        appdomain.DelegateManager.RegisterMethodDelegate <SceneRootEntry>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Boolean, System.String[]>();
        appdomain.DelegateManager.RegisterMethodDelegate <UnityEngine.GameObject, UnityEngine.GameObject>();
        appdomain.DelegateManager.RegisterMethodDelegate <UISprite>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.String, UnityEngine.GameObject, System.Boolean>();
        appdomain.DelegateManager.RegisterMethodDelegate <UIController>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Object, ILRuntime.Runtime.Intepreter.ILTypeInstance>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Single>();
        appdomain.DelegateManager.RegisterMethodDelegate <UnityEngine.Object>();
        appdomain.DelegateManager.RegisterMethodDelegate <TouchStartEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <TouchEndEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <EnemyController, System.Int32>();
        appdomain.DelegateManager.RegisterMethodDelegate <UnityEngine.Vector3>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Int32, System.Int32, System.Boolean>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Nullable <System.Int32> >();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Nullable <UnityEngine.Vector3> >();
        appdomain.DelegateManager.RegisterMethodDelegate <EB.Sparx.Game, EB.Sparx.Player>();
        appdomain.DelegateManager.RegisterMethodDelegate <global::TouchUpdateEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <global::TapEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <global::DoubleTapEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <global::TwoFingerTouchStartEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <global::TwoFingerTouchUpdateEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <global::TwoFingerTouchEndEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <UnityEngine.Vector3, System.Boolean>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.String, System.String, System.Object>();
        appdomain.DelegateManager.RegisterMethodDelegate <global::eGameState>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.String, System.ArraySegment <System.Byte> >();
        appdomain.DelegateManager.RegisterMethodDelegate <FlatBuffers.ByteBuffer>();
        appdomain.DelegateManager.RegisterMethodDelegate <EB.Sparx.Authenticator[]>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.Boolean, System.String>();
        appdomain.DelegateManager.RegisterMethodDelegate <EB.Sparx.Authenticator>();
        appdomain.DelegateManager.RegisterMethodDelegate <EB.Sparx.Authenticator, ILRuntime.Runtime.Intepreter.ILTypeInstance>();
        appdomain.DelegateManager.RegisterMethodDelegate <System.String, System.Boolean>();
        appdomain.DelegateManager.RegisterMethodDelegate <global::LevelStartEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <UnityEngine.GameObject, UnityEngine.KeyCode>();
        appdomain.DelegateManager.RegisterMethodDelegate <UnityEngine.ParticleSystem>();
        appdomain.DelegateManager.RegisterMethodDelegate <Hotfix_LT.Combat.Combatant>();
        appdomain.DelegateManager.RegisterMethodDelegate <Hotfix_LT.Combat.CombatHitDamageEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <Hotfix_LT.Combat.CombatDamageEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <Hotfix_LT.Combat.CombatHealEvent>();
        appdomain.DelegateManager.RegisterMethodDelegate <global::eUIDialogueButtons, global::UIDialogeOption>();
        appdomain.DelegateManager.RegisterMethodDelegate <string, UnityEngine.U2D.SpriteAtlas, bool>();
        appdomain.DelegateManager.RegisterMethodDelegate <string, UnityEngine.Texture2D, bool>();
        #region For JohnyAction
        appdomain.DelegateManager.RegisterMethodDelegate <Johny.Action.ActionAlphaChange.FinishStatus>();
        appdomain.DelegateManager.RegisterMethodDelegate <Johny.Action.ActionCellBornMove.FinishStatus>();
        appdomain.DelegateManager.RegisterMethodDelegate <Johny.Action.ActionCellStampDown.FinishStatus>();
        appdomain.DelegateManager.RegisterMethodDelegate <Johny.Action.ActionCellUpAndDownLoop.FinishStatus>();
        appdomain.DelegateManager.RegisterMethodDelegate <Johny.Action.ActionModelRotation.FinishStatus>();
        appdomain.DelegateManager.RegisterMethodDelegate <Johny.Action.ActionGeneralParticle.FinishStatus>();
        #endregion

        //DelegateManager.RegisterFunctionDelegate
        appdomain.DelegateManager.RegisterFunctionDelegate <EB.Sparx.Response, bool>();
        appdomain.DelegateManager.RegisterFunctionDelegate <UITabController.TabLibEntry, bool>();
        appdomain.DelegateManager.RegisterFunctionDelegate <ILRuntime.Runtime.Intepreter.ILTypeInstance, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <EB.IAP.Item, EB.IAP.Item, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <EB.Sparx.ChatMessage, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Collections.DictionaryEntry, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Collections.DictionaryEntry, System.Collections.DictionaryEntry, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <ILRuntime.Runtime.Intepreter.ILTypeInstance, ILRuntime.Runtime.Intepreter.ILTypeInstance, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <EB.Sparx.Response, EB.Sparx.eResponseCode, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.String, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Object, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <DynamicMonoILRObjectAdaptor.Adaptor, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <EB.Sparx.User, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <ParticleSystemUIComponent, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Int32, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Int32, System.Int32, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Int32, System.Int32, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Int32, System.Int32, System.String>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Int32, System.String>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Int32, System.Object>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.String, System.String, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <EB.Sparx.ChatMessage, EB.Sparx.ChatMessage, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.String, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Collections.DictionaryEntry, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Text.RegularExpressions.Match, System.String>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Collections.Generic.KeyValuePair <System.Int32, ILRuntime.Runtime.Intepreter.ILTypeInstance>, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Collections.Generic.KeyValuePair <System.Int32, ILRuntime.Runtime.Intepreter.ILTypeInstance>, ILRuntime.Runtime.Intepreter.ILTypeInstance>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Collections.Generic.KeyValuePair <System.String, ILRuntime.Runtime.Intepreter.ILTypeInstance>, System.Collections.Generic.KeyValuePair <System.String, ILRuntime.Runtime.Intepreter.ILTypeInstance>, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <ILRuntime.Runtime.Intepreter.ILTypeInstance, System.Int32>();
        appdomain.DelegateManager.RegisterFunctionDelegate <ILRuntime.Runtime.Intepreter.ILTypeInstance, System.String>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.String, System.Single>();
        // appdomain.DelegateManager.RegisterFunctionDelegate<System.Collections.Generic.List<global::ObjectManager.ManagedInstance>, System.Collections.IDictionary, global::ObjectManager.ManagedInstance>();
        appdomain.DelegateManager.RegisterFunctionDelegate <System.Object, System.Int32, ILRuntime.Runtime.Intepreter.ILTypeInstance>();
        appdomain.DelegateManager.RegisterFunctionDelegate <EB.Sparx.MHAuthenticator.UserInfo, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <Hotfix_LT.Combat.CombatCharacterSyncData, System.Boolean>();
        appdomain.DelegateManager.RegisterFunctionDelegate <UnityEngine.Transform, UnityEngine.Transform, System.Int32>();

        appdomain.DelegateManager.RegisterDelegateConvertor <EventDelegate.Callback>((action) =>
        {
            return(new EventDelegate.Callback(() =>
            {
                ((System.Action)action)();
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <UICenterOnChild.OnCenterCallback>((act) => {
            return(new UICenterOnChild.OnCenterCallback((centeredObject) => {
                ((System.Action <GameObject>)act)(centeredObject);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Predicate <UITabController.TabLibEntry> >((act) =>
        {
            return(new System.Predicate <UITabController.TabLibEntry>((obj) =>
            {
                return ((Func <UITabController.TabLibEntry, bool>)act)(obj);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Predicate <ILRuntime.Runtime.Intepreter.ILTypeInstance> >((act) =>
        {
            return(new System.Predicate <ILRuntime.Runtime.Intepreter.ILTypeInstance>((obj) =>
            {
                return ((Func <ILRuntime.Runtime.Intepreter.ILTypeInstance, System.Boolean>)act)(obj);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <UIEventListener.VoidDelegate>((act) =>
        {
            return(new UIEventListener.VoidDelegate((go) =>
            {
                ((Action <UnityEngine.GameObject>)act)(go);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Comparison <EB.IAP.Item> >((act) =>
        {
            return(new System.Comparison <EB.IAP.Item>((x, y) =>
            {
                return ((Func <EB.IAP.Item, EB.IAP.Item, System.Int32>)act)(x, y);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <UIEventListener.VectorDelegate>((act) =>
        {
            return(new UIEventListener.VectorDelegate((go, delta) =>
            {
                ((Action <UnityEngine.GameObject, UnityEngine.Vector2>)act)(go, delta);
            }));
        });

        appdomain.DelegateManager.RegisterDelegateConvertor <UIEventListener.BoolDelegate>((act) =>
        {
            return(new UIEventListener.BoolDelegate((go, state) =>
            {
                ((Action <UnityEngine.GameObject, System.Boolean>)act)(go, state);
            }));
        });

        appdomain.DelegateManager.RegisterDelegateConvertor <System.Predicate <EB.Sparx.ChatMessage> >((act) =>
        {
            return(new System.Predicate <EB.Sparx.ChatMessage>((obj) =>
            {
                return ((Func <EB.Sparx.ChatMessage, System.Boolean>)act)(obj);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <UITable.OnReposition>((act) =>
        {
            return(new UITable.OnReposition(() =>
            {
                ((Action)act)();
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Comparison <System.Collections.DictionaryEntry> >((act) =>
        {
            return(new System.Comparison <System.Collections.DictionaryEntry>((x, y) =>
            {
                return ((Func <System.Collections.DictionaryEntry, System.Collections.DictionaryEntry, System.Int32>)act)(x, y);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Comparison <ILRuntime.Runtime.Intepreter.ILTypeInstance> >((act) =>
        {
            return(new System.Comparison <ILRuntime.Runtime.Intepreter.ILTypeInstance>((x, y) =>
            {
                return ((Func <ILRuntime.Runtime.Intepreter.ILTypeInstance, ILRuntime.Runtime.Intepreter.ILTypeInstance, System.Int32>)act)(x, y);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <UIPanel.OnClippingMoved>((act) =>
        {
            return(new UIPanel.OnClippingMoved((panel) =>
            {
                ((Action <UIPanel>)act)(panel);
            }));
        });

        appdomain.DelegateManager.RegisterDelegateConvertor <global::GaussianBlurRT.Callback>((act) =>
        {
            return(new global::GaussianBlurRT.Callback((tex) =>
            {
                ((Action <UnityEngine.Texture>)act)(tex);
            }));
        });

        appdomain.DelegateManager.RegisterDelegateConvertor <System.Predicate <System.String> >((act) =>
        {
            return(new System.Predicate <System.String>((obj) =>
            {
                return ((Func <System.String, System.Boolean>)act)(obj);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Predicate <DynamicMonoILRObjectAdaptor.Adaptor> >((act) =>
        {
            return(new System.Predicate <DynamicMonoILRObjectAdaptor.Adaptor>((obj) =>
            {
                return ((Func <DynamicMonoILRObjectAdaptor.Adaptor, System.Boolean>)act)(obj);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Predicate <EB.Sparx.User> >((act) =>
        {
            return(new System.Predicate <EB.Sparx.User>((obj) =>
            {
                return ((Func <EB.Sparx.User, System.Boolean>)act)(obj);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <EB.Sparx.LevelRewardsManager.LevelRewardsChangeDel>((act) =>
        {
            return(new EB.Sparx.LevelRewardsManager.LevelRewardsChangeDel((status) =>
            {
                ((Action <EB.Sparx.LevelRewardsStatus>)act)(status);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Predicate <ParticleSystemUIComponent> >((act) =>
        {
            return(new System.Predicate <ParticleSystemUIComponent>((obj) =>
            {
                return ((Func <ParticleSystemUIComponent, System.Boolean>)act)(obj);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <SceneRootEntry.Begin>((act) =>
        {
            return(new SceneRootEntry.Begin(() =>
            {
                ((Action)act)();
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <SceneRootEntry.Failed>((act) =>
        {
            return(new SceneRootEntry.Failed(() =>
            {
                ((Action)act)();
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <SceneRootEntry.Loading>((act) =>
        {
            return(new SceneRootEntry.Loading((int loaded, int total) =>
            {
                ((Action <int, int>)act)(loaded, total);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <SceneRootEntry.Finished>((act) =>
        {
            return(new SceneRootEntry.Finished((SceneRootEntry entry) =>
            {
                ((Action <SceneRootEntry>)act)(entry);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <HudLoadManager.HudLoadComplete>((act) =>
        {
            return(new HudLoadManager.HudLoadComplete((NoError, Show) =>
            {
                ((Action <System.Boolean, System.String[]>)act)(NoError, Show);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Comparison <System.String> >((act) =>
        {
            return(new System.Comparison <System.String>((x, y) =>
            {
                return ((Func <System.String, System.String, System.Int32>)act)(x, y);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Comparison <EB.Sparx.ChatMessage> >((act) =>
        {
            return(new System.Comparison <EB.Sparx.ChatMessage>((x, y) =>
            {
                return ((Func <EB.Sparx.ChatMessage, EB.Sparx.ChatMessage, System.Int32>)act)(x, y);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Text.RegularExpressions.MatchEvaluator>((act) =>
        {
            return(new System.Text.RegularExpressions.MatchEvaluator((match) =>
            {
                return ((Func <System.Text.RegularExpressions.Match, System.String>)act)(match);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Comparison <System.Int32> >((act) =>
        {
            return(new System.Comparison <System.Int32>((x, y) =>
            {
                return ((Func <System.Int32, System.Int32, System.Int32>)act)(x, y);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.EventHandler <ILRuntime.Runtime.Intepreter.ILTypeInstance> >((act) =>
        {
            return(new System.EventHandler <ILRuntime.Runtime.Intepreter.ILTypeInstance>((sender, e) =>
            {
                ((Action <System.Object, ILRuntime.Runtime.Intepreter.ILTypeInstance>)act)(sender, e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <EventManager.EventDelegate <ILRuntime.Runtime.GeneratedAdapter.GameEventAdapter.Adapter> >((act) =>
        {
            return(new EventManager.EventDelegate <ILRuntime.Runtime.GeneratedAdapter.GameEventAdapter.Adapter>((e) =>
            {
                ((Action <ILRuntime.Runtime.GeneratedAdapter.GameEventAdapter.Adapter>)act)(e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <EventManager.EventDelegate <TouchStartEvent> >((act) =>
        {
            return(new EventManager.EventDelegate <TouchStartEvent>((e) =>
            {
                ((Action <TouchStartEvent>)act)(e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <EventManager.EventDelegate <TouchEndEvent> >((act) =>
        {
            return(new EventManager.EventDelegate <TouchEndEvent>((e) =>
            {
                ((Action <TouchEndEvent>)act)(e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Comparison <System.Collections.Generic.KeyValuePair <System.String, ILRuntime.Runtime.Intepreter.ILTypeInstance> > >((act) =>
        {
            return(new System.Comparison <System.Collections.Generic.KeyValuePair <System.String, ILRuntime.Runtime.Intepreter.ILTypeInstance> >((x, y) =>
            {
                return ((Func <System.Collections.Generic.KeyValuePair <System.String, ILRuntime.Runtime.Intepreter.ILTypeInstance>, System.Collections.Generic.KeyValuePair <System.String, ILRuntime.Runtime.Intepreter.ILTypeInstance>, System.Int32>)act)(x, y);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::CharacterTargetingComponent.MovementTargetChangeRequestEventHandler>((act) =>
        {
            return(new global::CharacterTargetingComponent.MovementTargetChangeRequestEventHandler((requestedTarget, isNull) =>
            {
                ((Action <UnityEngine.Vector3, bool>)act)(requestedTarget, isNull);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::CharacterTargetingComponent.AttackTargetChangedEventHandler>((act) =>
        {
            return(new global::CharacterTargetingComponent.AttackTargetChangedEventHandler((newAttackTarget) =>
            {
                ((Action <UnityEngine.GameObject>)act)(newAttackTarget);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::GameListenerFusion.PlayerLeftHandler>((act) =>
        {
            return(new global::GameListenerFusion.PlayerLeftHandler((game, player) =>
            {
                ((Action <EB.Sparx.Game, EB.Sparx.Player>)act)(game, player);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::EventManager.EventDelegate <global::TouchUpdateEvent> >((act) =>
        {
            return(new global::EventManager.EventDelegate <global::TouchUpdateEvent>((e) =>
            {
                ((Action <global::TouchUpdateEvent>)act)(e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::EventManager.EventDelegate <global::TapEvent> >((act) =>
        {
            return(new global::EventManager.EventDelegate <global::TapEvent>((e) =>
            {
                ((Action <global::TapEvent>)act)(e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::EventManager.EventDelegate <global::DoubleTapEvent> >((act) =>
        {
            return(new global::EventManager.EventDelegate <global::DoubleTapEvent>((e) =>
            {
                ((Action <global::DoubleTapEvent>)act)(e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::EventManager.EventDelegate <global::TwoFingerTouchStartEvent> >((act) =>
        {
            return(new global::EventManager.EventDelegate <global::TwoFingerTouchStartEvent>((e) =>
            {
                ((Action <global::TwoFingerTouchStartEvent>)act)(e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::EventManager.EventDelegate <global::TwoFingerTouchEndEvent> >((act) =>
        {
            return(new global::EventManager.EventDelegate <global::TwoFingerTouchEndEvent>((e) =>
            {
                ((Action <global::TwoFingerTouchEndEvent>)act)(e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::EventManager.EventDelegate <global::TwoFingerTouchUpdateEvent> >((act) =>
        {
            return(new global::EventManager.EventDelegate <global::TwoFingerTouchUpdateEvent>((e) =>
            {
                ((Action <global::TwoFingerTouchUpdateEvent>)act)(e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <EB.Sparx.DataCacheManager.OnFlatBuffersDataCacheUpdated>((act) =>
        {
            return(new EB.Sparx.DataCacheManager.OnFlatBuffersDataCacheUpdated((name, buffer) =>
            {
                ((Action <System.String, System.ArraySegment <System.Byte> >)act)(name, buffer);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::EventManager.EventDelegate <global::LevelStartEvent> >((act) =>
        {
            return(new global::EventManager.EventDelegate <global::LevelStartEvent>((e) =>
            {
                ((Action <global::LevelStartEvent>)act)(e);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::UIEventListener.KeyCodeDelegate>((act) =>
        {
            return(new global::UIEventListener.KeyCodeDelegate((go, key) =>
            {
                ((Action <UnityEngine.GameObject, UnityEngine.KeyCode>)act)(go, key);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Predicate <EB.Sparx.MHAuthenticator.UserInfo> >((act) =>
        {
            return(new System.Predicate <EB.Sparx.MHAuthenticator.UserInfo>((obj) =>
            {
                return ((Func <EB.Sparx.MHAuthenticator.UserInfo, System.Boolean>)act)(obj);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::CTimer.OnTimeUpHandler>((act) =>
        {
            return(new global::CTimer.OnTimeUpHandler((timerSequence) =>
            {
                ((Action <System.Int32>)act)(timerSequence);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <Hotfix_LT.UI.LTCombatEventReceiver.CombatantCallbackVoid>((act) =>
        {
            return(new Hotfix_LT.UI.LTCombatEventReceiver.CombatantCallbackVoid((combatant) =>
            {
                ((Action <Hotfix_LT.Combat.Combatant>)act)(combatant);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Predicate <Hotfix_LT.Combat.CombatCharacterSyncData> >((act) =>
        {
            return(new System.Predicate <Hotfix_LT.Combat.CombatCharacterSyncData>((obj) =>
            {
                return ((Func <Hotfix_LT.Combat.CombatCharacterSyncData, System.Boolean>)act)(obj);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <global::OnUIDialogueButtonClick>((act) =>
        {
            return(new global::OnUIDialogueButtonClick((button, option) =>
            {
                ((Action <global::eUIDialogueButtons, global::UIDialogeOption>)act)(button, option);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <DG.Tweening.TweenCallback>((act) =>
        {
            return(new DG.Tweening.TweenCallback(() =>
            {
                ((Action)act)();
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <System.Comparison <UnityEngine.Transform> >((act) =>
        {
            return(new System.Comparison <UnityEngine.Transform>((x, y) =>
            {
                return ((Func <UnityEngine.Transform, UnityEngine.Transform, System.Int32>)act)(x, y);
            }));
        });
        appdomain.DelegateManager.RegisterDelegateConvertor <DG.Tweening.Core.DOSetter <System.Single> >((act) =>
        {
            return(new DG.Tweening.Core.DOSetter <System.Single>((pNewValue) =>
            {
                ((Action <System.Single>)act)(pNewValue);
            }));
        });

        //这个必须要!!!
        ILRuntime.Runtime.Generated.CLRBindings.Initialize(appdomain);
    }
예제 #25
0
        /// <summary>
        /// 对加载预制完成的数据进行处理(热更的处理,预制嵌套的处理等)
        /// </summary>
        /// <param name="isHotfix"></param>
        /// <param name="assetName"></param>
        /// <param name="go"></param>
        /// <returns></returns>
        IEnumerator Process(bool isHotfix, string assetName, GameObject go)
        {
            if (isHotfix)
            {
                while (!HotfixILRManager.GetInstance().IsInit)
                {
                    yield return(null);
                }
            }

            PrefabCreator[] pcs = go.GetComponentsInChildren <PrefabCreator>(true);
            for (int i = 0; i < pcs.Length; i++)
            {
                pcs[i].LoadAsset();
            }

            PrefabLoader[] loaders = go.GetComponentsInChildren <PrefabLoader>(true);
            for (int i = 0; i < loaders.Length; i++)
            {
                loaders[i].LoadPrefab();
            }

            bool isPloaded = false;

            while (!isPloaded)
            {
                isPloaded = true;
                for (int i = 0; i < pcs.Length; i++)
                {
                    if (!pcs[i].isCurrendAssetLoaded)
                    {
                        isPloaded = false;
                        break;
                    }
                }
                if (!isPloaded)
                {
                    yield return(null);
                }
            }

            bool isLoaded = false;

            while (!isLoaded)
            {
                isLoaded = true;
                for (int i = 0; i < loaders.Length; i++)
                {
                    if (!loaders[i].IsAssetLoaded)
                    {
                        isLoaded = false;
                        break;
                    }
                }
                if (!isLoaded)
                {
                    yield return(null);
                }
            }

            if (isHotfix)
            {
                if (go.GetComponent <UIControllerILR>() == null)
                {
                    UIControllerILR ucr = go.AddComponent <UIControllerILR>();
                    ucr.hotfixClassPath = hotfixClassPath;
                    ucr.ILRObjInit();
                }
                else
                {
                    UIControllerILR ucr = go.GetComponent <UIControllerILR>();
                    ucr.ILRObjInit();
                }
            }

            OnAssetProcess(assetName, go);
        }
예제 #26
0
    public override IEnumerator Start(GameState oldState)
    {
        //debug服务器选择界面 debug screen view
#if DEBUG && !NO_DEBUG_SCREEN
        DebugSystem.DebugCameraClearNothing();
#endif

#if !UNITY_EDITOR && USE_AOSHITANGSDK
        EB.Sparx.AoshitangSDKManager.getInstance().AstSDKInit();
        yield return(new WaitUntil(() => EB.Sparx.AoshitangSDKManager.getInstance().SDKInitSuccess));

        //ShowWaitSDKInitScreen(false);花屏问题,得等loading出来再隐藏
#endif

        //获取本地的玩家设置 load playersetting
        UserData.DeserializePrefs();

        //加载当前语言的基础包
        EB.Localizer.LoadCurrentLanguageBase(UserData.Locale);

        //加载证书 load certificates
        EB.Net.TcpClientFactory.LoadCertStore("Crypto/Certs");

        //加载hosts配置 load hosts
        EB.Net.DNS.LoadHosts("hosts");

        //展示黑白提示界面,如果需要跳过请在协程内部最后加判断跳过 show warning loading
        yield return(GameEngine.Instance.StartCoroutine(LTDownloadHudConroller.instance.ShowWarningScreen())); //GameEngine.Instance.StartCoroutine(UIStack.Instance.ShowWarningScreen());

        //显示普通loading界面(加载中。。。) show splash screen
        yield return(GameEngine.Instance.StartCoroutine(LTDownloadHudConroller.instance.ShowSplashScreen()));//GameEngine.Instance.StartCoroutine(ShowSplashScreen());

#if !UNITY_EDITOR && USE_AOSHITANGSDK
        ShowWaitSDKInitScreen(false);
#endif

        //网络检测是否联网 confirm network
        yield return(LTDownloadHudConroller.instance.WaitForNetwork());//BlockForNetworkWithDialog();

#if USE_AOSHITANGSDK
        if (PlayerPrefs.GetInt("astfirstopen", -1) != 1)
        {
            EB.Sparx.AoshitangSDKManager.getInstance().UploadLog("firstOpen", delegate(bool scucess) {
                if (scucess)
                {
                    PlayerPrefs.SetInt("astfirstopen", 1);
                    PlayerPrefs.Save();
                }
            });
        }
        EB.Sparx.AoshitangSDKManager.getInstance().UploadLog("open", null);
#endif
        EB.Debug.Log("USE_AOSHITANGSDK Pass!!!!");

        //获取api跟ota服务器信息 fetch api sever and ota server
        yield return(GameEngine.Instance.StartCoroutine(FetchServerList()));

        EB.Debug.Log("FetchServerList Pass!!!!");

        if (GameEngine.Instance.ServerMaintenance)
        {
            //服务器维护 server maintenance
            LTDownloadHudConroller.instance.ShowTip(GameEngine.Instance.MaintenanceMessage);
            yield break;
        }

        EB.Debug.Log("ServerMaintenance Pass!!!!");

        #region  载AB包
        //资源限制配置 resource limit
        GM.AssetManager.MaxDecompressQueueSize = 100;
        GM.AssetManager.MaxMemorySize          = 200 * 1024 * 1024;
        GM.AssetManager.InitilizeThreadPool();

        //加载本地包体中的bundles
        yield return(GameEngine.Instance.StartCoroutine(DownloadFromStreamingFolder()));

        EB.Debug.Log("DownloadFromStreamingFolder Pass!!!!");

        //下载服务器的bundles
        yield return(GameEngine.Instance.StartCoroutine(DowloadFromOtaServer()));

        EB.Debug.Log("DowloadFromOtaServer Pass!!!!");

        #region 强制回收GC
        System.GC.Collect(System.GC.MaxGeneration, System.GCCollectionMode.Forced);
        System.GC.WaitForPendingFinalizers();
        System.GC.Collect();
        #endregion

        EB.Debug.Log("GC Pass!!!!");

        //背景下载资源限制配置 background download resource limit
        GM.AssetManager.MaxDecompressQueueSize = 100;
        GM.AssetManager.MaxMemorySize          = 50 * 1024 * 1024;
        GM.BundleDownloader.threadPool.Resize(2);

        //保存版本文件信息 save version info
        if (UserData.InitedVersion != EB.Version.GetFullVersion())
        {
            UserData.InitedVersion = EB.Version.GetFullVersion();
            UserData.SerializePrefs();
        }

        EB.Debug.Log("save version info Pass!!!!");
        #endregion



        #region 加载CommonText
        InitBundleTextData();
        yield return(_waitUntilBundleTextData);

        #endregion

        EB.Debug.Log("InitBundleTextData Pass!!!!");

        //加载Bundle中的当前语言文本
        yield return(LoadCurrentLanguageText());

        EB.Debug.Log("LoadCurrentLanguageText Pass!!!!");

#if !UNITY_EDITOR
        //加载bundle配置表信息 load datacaches
        yield return(LoadAllDataCachesFromBundles());
#endif

        EB.Debug.Log("LoadAllDataCachesFromBundles Pass!!!!");

        #region InjectFix初始化 Inject Init
#if !UNITY_EDITOR
        yield return(IFix.InjectPatchManager.Instance.LoadScriptPatch());
#endif
        #endregion

        EB.Debug.Log("InjectPatchManager Pass!!!!");

        #region ILR初始化 ILR Init
        EB.Coroutines.Run(HotfixILRManager.GetInstance().StartProcess());
        while (!HotfixILRManager.GetInstance().IsInit)
        {
            yield return(null);
        }
        yield return(null); //多等一帧 给依赖HotfixILRManager.GetInstance().IsInit判断初始化的协程能执行

        #endregion

        #region 初始化DynamicMonoILR
        EB.Debug.Log("DynamicMonoILR LTGameStateHofixController");
        var mono = GameStateManager.Instance.gameObject.AddComponent <DynamicMonoILR>();
        mono.hotfixClassPath = "Hotfix_LT.GameState.LTGameStateHofixController";
        mono.ILRObjInit();
        #endregion

        //初始化数据统计管理器
        GlobalUtils.CallStaticHotfix("Hotfix_LT.UI.FusionTelemetry", "Initialize");



        #region 加载一坨不知道啥
        EB.Assets.LoadAsyncAndInit <UnityEngine.Object>("CharacterDependencies", null, GameEngine.Instance.gameObject);
        EB.Assets.LoadAsyncAndInit <UnityEngine.Object>("fx_aura04_Blueuv_02", null, GameEngine.Instance.gameObject);
        EB.Assets.LoadAsyncAndInit <UnityEngine.Object>("fx_dj_Reduv_fx02", null, GameEngine.Instance.gameObject);
        EB.Assets.LoadAsyncAndInit <UnityEngine.Object>("fx_Glo_0049", null, GameEngine.Instance.gameObject);
        EB.Assets.LoadAsyncAndInit <UnityEngine.Object>("fx_glwo_guangyun", null, GameEngine.Instance.gameObject);
        EB.Assets.LoadAsyncAndInit <UnityEngine.Object>("fx_m_bai_s", null, GameEngine.Instance.gameObject);
        #endregion

        EB.Debug.Log("GameDownload Pass!!!!");
    }