薛之猫大王
17 hours ago da45ccae4c4b03fa50308b442a04ccfd3de160e0
添加文档注释
2 files modified
48 ■■■■ changed files
Assets/Scripts/Hotfix/MVC/Base/AppFacade.cs 13 ●●●●● patch | view | raw | blame | history
Assets/Scripts/Hotfix/MVC/View_Mediator/Login/LoginMediator.cs 35 ●●●● patch | view | raw | blame | history
Assets/Scripts/Hotfix/MVC/Base/AppFacade.cs
@@ -223,6 +223,7 @@
        /// 解耦:对象间解耦,互不直接依赖
        /// 可扩展:新增中介者只需注册,无需修改现有代码
        /// 可维护:统一管理对象关系,易于维护
        /// 但是这里的中介者更像视图控制器
        /// </summary>
        public override void RegisterMediator(IMediator mediator)////注册视图控制器中介者
        {
@@ -289,7 +290,17 @@
                m_globalMap.Remove(mediatorName);
            }
        }
        /// <summary>
        /// 观察者模式:定义对象间的一对多依赖,让多个对象不需要直接交互,通过观察者协调
        /// 工作原理:
        /// 注册:将观察者与被观察者绑定
        ///   RegisterObserver(new Observer());
        /// 触发:被观察者状态改变时通知观察者
        ///   AppFacade.GetInstance().SendNotification("PlayerInfoChanged", playerData);
        /// 处理:观察者实现 HandleNotification 方法处理业务逻辑
        /// 优势:
        /// 解耦:对象间解耦,互不直接依赖
        /// </summary>
        public override void SendNotification(string notificationName, object body = null, string type = null)
        {
            base.SendNotification(notificationName, body, type);
Assets/Scripts/Hotfix/MVC/View_Mediator/Login/LoginMediator.cs
@@ -1,9 +1,9 @@
// =============================================================================== 
// Author              :    Gen By Tools
// Create Time         :    Tuesday, December 24, 2019
// Update Time         :    Tuesday, December 24, 2019
// Author              :    薛之猫
// Create Time         :    Sunday, January 11, 2026
// Update Time         :    Sunday, January 11, 2026
// Class Description   :    LoginMediator
// Copyright IGG All rights reserved.
// Copyright 虚幻骑士科技 All rights reserved.
// ===============================================================================
using UnityEngine;
@@ -16,20 +16,41 @@
using UnityEngine.UI;
namespace Game {
    /// <summary>
    /// 登录视图控制器中介者
    /// </summary>
    public class LoginMediator : GameMediator {
        #region Member
        #region 成员
        /// <summary>
        /// 中介者名称,作为视图中介者的唯一标识符,用于在AppFacade中查找和注册,或者移除中介者
        /// </summary>
        public static string NameMediator = "LoginMediator";
        /// <summary>
        /// 玩家代理
        /// </summary>
        private PlayerProxy _playerProxy;
        /// <summary>
        /// 上次登录名称
        /// </summary>
        private string _lastLoginName;
        /// <summary>
        /// 网络代理
        /// </summary>
        private NetProxy m_netProxy;
        
        #endregion
        //IMediatorPlug needs
        /// <summary>
        /// 构造函数,构造的视图组件交给中介者管理
        /// </summary>
        /// <param name="viewComponent">视图组件</param>
        public LoginMediator(object viewComponent ):base(NameMediator, viewComponent ) {}
        /// <summary>
        /// 登录视图
        /// </summary>
        public LoginView view;
        private string m_serverIP;
@@ -50,7 +71,7 @@
       
        #region UI template method
        #region UI 模板方法
        public override void OpenAniEnd(){