Exemplo n.º 1
0
        sealed public override void Init()
        {
            base.Init();

            mUIHotFixer = this;

            HotFixerInteractor interacter = UIInteracterCreater?.Invoke();

            interacter.SetUIModular(mUIHotFixer);

            if (UIInteracterHandler != default)
            {
                mUI.Remove(UIModularHandler);
                mUI.Add(UIInteracterHandler);
                "log: UI {0} add modular handler (UIInteracterHandler), UI type is ".Log(mUI.ToString());
            }
            else
            {
            }

            mBridge = UIAgent.Bridge;
            mBridge.SetHotFixInteractor(interacter);

            ILRuntimeUtils.InvokeMethodILR(mUIHotFixer, UIAgent.UIModularName, "UIInit", 0);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 相应更新远程资源事件的处理函数
        /// </summary>
        public virtual void UpdateRemoteAssetHandler()
        {
            HotFixSubgroup hotFixSubgroup = GameComponent.HotFixSubgroup;

            if (hotFixSubgroup.applyILRuntime && !string.IsNullOrEmpty(hotFixSubgroup.initerNameInResource))
            {
#if ILRUNTIME
                StartILRuntime();
#endif
                GameObject mainBridge = Resources.Load <GameObject>(hotFixSubgroup.initerNameInResource);
                mainBridge = Instantiate(mainBridge);

                HotFixerComponent hotfixer = mainBridge.GetComponent <HotFixerComponent>();
                ILRuntimeUtils.InvokeMethodILR(hotfixer.ShellBridge, hotFixSubgroup.initerClassName, hotFixSubgroup.initerGameCompSetter, 1, GameComponent);
            }
            else
            {
                mClientVersions = GameComponent.DevelopSetting.remoteAssetVersions;
                if (mClientVersions != default)
                {
                    UIManager uis = ShipDockApp.Instance.UIs;
                    mStartingUpdatePopup = (IStartingUpdatePopup)uis.OpenResourceUI <MonoBehaviour>(GameComponent.DevelopSetting.resUpdatePopupPath);
                    mClientVersions.LoadRemoteVersion(OnLoadComplete, OnVersionInvalid, out _);//加载远端服务器的资源版本
                }
                else
                {
                    AfterStartingLoadComplete();
                }
            }
        }
Exemplo n.º 3
0
        public static void ClearDebugService()
        {
#if DEBUG && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IPHONE)
            isDebugServiceStarted = false;
            AppDomain appDomain = ILRuntimeUtils.GetILRuntimeHotFix().ILAppDomain;
            appDomain.DebugService.StopDebugService();
#endif
        }
Exemplo n.º 4
0
        public sealed override void Interrupt()
        {
            base.Interrupt();

            if (!IsExited)
            {
                ILRuntimeUtils.InvokeMethodILR(mUIHotFixer, UIAgent.UIModularName, "UIInterrupt", 0);
            }
            else
            {
            }
        }
Exemplo n.º 5
0
        public static void StartDebugServices(int debugPort)
        {
#if DEBUG && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IPHONE)
            if (!isDebugServiceStarted)
            {
                isDebugServiceStarted = true;
                AppDomain appDomain = ILRuntimeUtils.GetILRuntimeHotFix().ILAppDomain;
                appDomain.UnityMainThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;
                appDomain.DebugService.StartDebugService(debugPort);
            }
            else
            {
            }
#endif
        }
Exemplo n.º 6
0
        protected sealed override void Purge()
        {
            if (UIInteracterHandler != default)
            {
                mUI.Remove(UIInteracterHandler);
            }
            else
            {
            }

            ILRuntimeUtils.InvokeMethodILR(mUIHotFixer, UIAgent.UIModularName, "UIExit", 0);

            mBridge     = default;
            mUIHotFixer = default;
        }
Exemplo n.º 7
0
        private void ApplyCustomNotice()
        {
            string methodName = m_LoadedNoticeInfo.GetIDAsCustomNoticeMethod;

            if (string.IsNullOrEmpty(methodName))
            {
                mIDAsNotice = Pooling <Notice> .From();
            }
            else
            {
                ILRuntimeUtils.InvokeMethodILR(ShellBridge, m_StartUpInfo.ClassName, methodName, 0, OnGetIDAsNoticeHandler);
                if (mIDAsNotice == default)
                {
                    mIDAsNotice = Pooling <Notice> .From();
                }
                else
                {
                }
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// ILRuntime热更应用域引用
 /// </summary>
 /// <returns></returns>
 protected virtual AppDomain ILAppDomain()
 {
     return(ILRuntimeUtils.GetILRuntimeHotFix().ILAppDomain);
 }
Exemplo n.º 9
0
 public void SetHotFixInteractor(HotFixerInteractor target)
 {
     HotFixerInteractor = target;
     ILRuntimeUtils.InvokeMethodILR(target, Agent.UIInteractorName, "InitInteractor", 2, this, Agent);
 }
Exemplo n.º 10
0
        protected override void ILRuntimeLoaded()
        {
            base.ILRuntimeLoaded();

            ILRuntimeUtils.InvokeMethodILR(ShellBridge, m_StartUpInfo.ClassName, "SetEnterInitedCallback", 2, ShipDockAppOwner, ILHotFixerEnterInited);
        }
Exemplo n.º 11
0
        sealed public override void Enter()
        {
            base.Enter();

            ILRuntimeUtils.InvokeMethodILR(mUIHotFixer, UIAgent.UIModularName, "UIEnter", 0);
        }
Exemplo n.º 12
0
        protected sealed override void ShowUI()
        {
            base.ShowUI();

            ILRuntimeUtils.InvokeMethodILR(mUIHotFixer, UIAgent.UIModularName, "UIShow", 0);
        }