diff --git a/Assets/Bundles/UI/UILogin/UILogin.prefab b/Assets/Bundles/UI/UILogin/UILogin.prefab index f73d6af..5e675ac 100644 --- a/Assets/Bundles/UI/UILogin/UILogin.prefab +++ b/Assets/Bundles/UI/UILogin/UILogin.prefab @@ -401,17 +401,17 @@ MonoBehaviour: m_GameObject: {fileID: 3717230910800151908} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 75cb7ee26b0e470f89486d78d2fbcf47, type: 3} + m_Script: {fileID: 11500000, guid: 17506338c6696f34fb32a857b7483118, type: 3} m_Name: m_EditorClassIdentifier: - mUserName: {fileID: 4555843164057052725} mUserName__Placeholder: {fileID: 5546185728079920783} mUserName__Text: {fileID: 2292713627810620296} - mPassword: {fileID: 8573712159762856585} + mUserName: {fileID: 4555843164057052725} mPassword__Placeholder: {fileID: 967379718805668231} mPassword__Text: {fileID: 9038635317787761321} - menter: {fileID: 8766712165321420368} + mPassword: {fileID: 8573712159762856585} menter__Text: {fileID: 1318175656029300258} + menter: {fileID: 8766712165321420368} mErrorText: {fileID: 7984387176934010493} mTitleText: {fileID: 1529636909} --- !u!1 &5484277854968332070 diff --git a/Assets/Bundles/UI/UILogin/UIPlayerList.prefab b/Assets/Bundles/UI/UILogin/UIPlayerList.prefab index 67b4ee2..23a03e5 100644 --- a/Assets/Bundles/UI/UILogin/UIPlayerList.prefab +++ b/Assets/Bundles/UI/UILogin/UIPlayerList.prefab @@ -57,7 +57,7 @@ MonoBehaviour: m_GameObject: {fileID: 549651788788559724} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b1db4c50cefe4443bb435a753c3ecebc, type: 3} + m_Script: {fileID: 11500000, guid: be8f1c751178dd84b8584945bb5e43a1, type: 3} m_Name: m_EditorClassIdentifier: mleft_Panel__ScrollView__Viewport__Content: {fileID: 4719756363520927840} diff --git a/Assets/Bundles/UI/UIMain/UIMain.prefab b/Assets/Bundles/UI/UIMain/UIMain.prefab index 02a472b..ab778e8 100644 --- a/Assets/Bundles/UI/UIMain/UIMain.prefab +++ b/Assets/Bundles/UI/UIMain/UIMain.prefab @@ -486,12 +486,12 @@ MonoBehaviour: m_GameObject: {fileID: 1184977374874224108} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: cafa38f61d9d4d40abfbc25ba3ab6a46, type: 3} + m_Script: {fileID: 11500000, guid: 6d7207ee58c654f439fd0477b79046d0, type: 3} m_Name: m_EditorClassIdentifier: mBgImage: {fileID: 7785376669766979963} - mbag_button: {fileID: 1678343360} mbag_button__Text: {fileID: 1214814195} + mbag_button: {fileID: 1678343360} mplayer_icon: {fileID: 346919067406639900} mplayer_name: {fileID: 1887894341} mplayer_level: {fileID: 2091764510} diff --git a/Assets/Hotfix/UI/Logic/UILogin/UILogin.cs b/Assets/Hotfix/UI/Logic/UILogin/UILogin.Logic.cs similarity index 97% rename from Assets/Hotfix/UI/Logic/UILogin/UILogin.cs rename to Assets/Hotfix/UI/Logic/UILogin/UILogin.Logic.cs index 9889fc5..6a16fa4 100644 --- a/Assets/Hotfix/UI/Logic/UILogin/UILogin.cs +++ b/Assets/Hotfix/UI/Logic/UILogin/UILogin.Logic.cs @@ -1,106 +1,106 @@ -using System.Net; -using GameFrameX; -using GameFrameX.Event.Runtime; -#if ENABLE_UI_FAIRYGUI -using GameFrameX.UI.FairyGUI.Runtime; -#endif -using GameFrameX.Network.Runtime; -using GameFrameX.Runtime; -using GameFrameX.UI.Runtime; -#if ENABLE_UI_UGUI -using GameFrameX.UI.UGUI.Runtime; -#endif -using Hotfix.Config.item; -using Hotfix.Network; -using Hotfix.Proto; -using UnityEngine; - -namespace Hotfix.UI -{ - public partial class UILogin - { - private static INetworkChannel networkChannel; - public static string serverIp = "127.0.0.1"; - public static int serverPort = 29100; - - public override void OnOpen(object userData) - { - m_enter.onClick.Set(OnLoginClick); - base.OnOpen(userData); - } - - private void OnLoginClick() - { - if (networkChannel != null && networkChannel.Connected) - { - Login(); - return; - } - - if (networkChannel != null && GameApp.Network.HasNetworkChannel("network") && !networkChannel.Connected) - { - GameApp.Network.DestroyNetworkChannel("network"); - } - - networkChannel = GameApp.Network.CreateNetworkChannel("network", new DefaultNetworkChannelHelper()); - // 注册心跳消息 - DefaultPacketHeartBeatHandler packetSendHeaderHandler = new DefaultPacketHeartBeatHandler(); - networkChannel.RegisterHeartBeatHandler(packetSendHeaderHandler); - networkChannel.Connect(IPAddress.Parse(serverIp), serverPort); - GameApp.Event.CheckSubscribe(NetworkConnectedEventArgs.EventId, OnNetworkConnected); - GameApp.Event.CheckSubscribe(NetworkClosedEventArgs.EventId, OnNetworkClosed); - } - - private async void Login() - { - var item = GameApp.Config.GetConfig().Get(1); - Log.Info(item); - if (m_UserName.text.IsNullOrWhiteSpace() || m_Password.text.IsNullOrWhiteSpace()) - { - m_ErrorText.text = "用户名或密码不能为空"; - return; - } - - - var req = new ReqLogin - { - SdkType = 0, - SdkToken = "", - UserName = m_UserName.text, - Password = m_Password.text, - Device = SystemInfo.deviceUniqueIdentifier - }; - req.Platform = PathHelper.GetPlatformName; - - RespLogin respLogin = await networkChannel.Call(req); - Log.Info(respLogin); - ReqPlayerList reqPlayerList = new ReqPlayerList(); - - reqPlayerList.Id = respLogin.Id; - - var respPlayerList = await networkChannel.Call(reqPlayerList); - if (respPlayerList.PlayerList.Count > 0) - { - await GameApp.UI.OpenUIFormAsync(Utility.Asset.Path.GetUIPath(nameof(UILogin)), UIGroupConstants.Floor.Name, respLogin, true); - } - else - { - await GameApp.UI.OpenUIFormAsync(Utility.Asset.Path.GetUIPath(nameof(UILogin)), UIGroupConstants.Floor.Name, respLogin, true); - } - - // await GameApp.UI.OpenUIFormAsync(Utility.Asset.Path.GetUIPath(nameof(UIMain)), UIGroupConstants.Floor.Name); - GameApp.UI.CloseUIForm(this); - } - - private static void OnNetworkClosed(object sender, GameEventArgs e) - { - Log.Info(nameof(OnNetworkClosed)); - } - - private void OnNetworkConnected(object sender, GameEventArgs e) - { - Login(); - Log.Info(nameof(OnNetworkConnected)); - } - } +using System.Net; +using GameFrameX; +using GameFrameX.Event.Runtime; +#if ENABLE_UI_FAIRYGUI +using GameFrameX.UI.FairyGUI.Runtime; +#endif +using GameFrameX.Network.Runtime; +using GameFrameX.Runtime; +using GameFrameX.UI.Runtime; +#if ENABLE_UI_UGUI +using GameFrameX.UI.UGUI.Runtime; +#endif +using Hotfix.Config.item; +using Hotfix.Network; +using Hotfix.Proto; +using UnityEngine; + +namespace Hotfix.UI +{ + public partial class UILogin + { + private static INetworkChannel networkChannel; + public static string serverIp = "127.0.0.1"; + public static int serverPort = 29100; + + public override void OnOpen(object userData) + { + m_enter.onClick.Set(OnLoginClick); + base.OnOpen(userData); + } + + private void OnLoginClick() + { + if (networkChannel != null && networkChannel.Connected) + { + Login(); + return; + } + + if (networkChannel != null && GameApp.Network.HasNetworkChannel("network") && !networkChannel.Connected) + { + GameApp.Network.DestroyNetworkChannel("network"); + } + + networkChannel = GameApp.Network.CreateNetworkChannel("network", new DefaultNetworkChannelHelper()); + // 注册心跳消息 + DefaultPacketHeartBeatHandler packetSendHeaderHandler = new DefaultPacketHeartBeatHandler(); + networkChannel.RegisterHeartBeatHandler(packetSendHeaderHandler); + networkChannel.Connect(IPAddress.Parse(serverIp), serverPort); + GameApp.Event.CheckSubscribe(NetworkConnectedEventArgs.EventId, OnNetworkConnected); + GameApp.Event.CheckSubscribe(NetworkClosedEventArgs.EventId, OnNetworkClosed); + } + + private async void Login() + { + var item = GameApp.Config.GetConfig().Get(1); + Log.Info(item); + if (m_UserName.text.IsNullOrWhiteSpace() || m_Password.text.IsNullOrWhiteSpace()) + { + m_ErrorText.text = "用户名或密码不能为空"; + return; + } + + + var req = new ReqLogin + { + SdkType = 0, + SdkToken = "", + UserName = m_UserName.text, + Password = m_Password.text, + Device = SystemInfo.deviceUniqueIdentifier + }; + req.Platform = PathHelper.GetPlatformName; + + RespLogin respLogin = await networkChannel.Call(req); + Log.Info(respLogin); + ReqPlayerList reqPlayerList = new ReqPlayerList(); + + reqPlayerList.Id = respLogin.Id; + + var respPlayerList = await networkChannel.Call(reqPlayerList); + if (respPlayerList.PlayerList.Count > 0) + { + await GameApp.UI.OpenUIFormAsync(Utility.Asset.Path.GetUIPath(nameof(UILogin)), UIGroupConstants.Floor.Name, respLogin, true); + } + else + { + await GameApp.UI.OpenUIFormAsync(Utility.Asset.Path.GetUIPath(nameof(UILogin)), UIGroupConstants.Floor.Name, respLogin, true); + } + + // await GameApp.UI.OpenUIFormAsync(Utility.Asset.Path.GetUIPath(nameof(UIMain)), UIGroupConstants.Floor.Name); + GameApp.UI.CloseUIForm(this); + } + + private static void OnNetworkClosed(object sender, GameEventArgs e) + { + Log.Info(nameof(OnNetworkClosed)); + } + + private void OnNetworkConnected(object sender, GameEventArgs e) + { + Login(); + Log.Info(nameof(OnNetworkConnected)); + } + } } \ No newline at end of file diff --git a/Assets/Hotfix/UI/Logic/UILogin/UILogin.cs.meta b/Assets/Hotfix/UI/Logic/UILogin/UILogin.Logic.cs.meta similarity index 100% rename from Assets/Hotfix/UI/Logic/UILogin/UILogin.cs.meta rename to Assets/Hotfix/UI/Logic/UILogin/UILogin.Logic.cs.meta diff --git a/Assets/Hotfix/UI/Logic/UILogin/UIPlayerCreate.cs b/Assets/Hotfix/UI/Logic/UILogin/UIPlayerCreate.Logic.cs similarity index 96% rename from Assets/Hotfix/UI/Logic/UILogin/UIPlayerCreate.cs rename to Assets/Hotfix/UI/Logic/UILogin/UIPlayerCreate.Logic.cs index d6daf1c..98113ca 100644 --- a/Assets/Hotfix/UI/Logic/UILogin/UIPlayerCreate.cs +++ b/Assets/Hotfix/UI/Logic/UILogin/UIPlayerCreate.Logic.cs @@ -1,47 +1,47 @@ -using GameFrameX; -#if ENABLE_UI_FAIRYGUI -using GameFrameX.UI.FairyGUI.Runtime; -#endif -using GameFrameX.Runtime; -using GameFrameX.UI.Runtime; -#if ENABLE_UI_UGUI -using GameFrameX.UI.UGUI.Runtime; -#endif -using Hotfix.Proto; - -namespace Hotfix.UI -{ - public partial class UIPlayerCreate - { - ReqPlayerCreate req; - - public override void OnOpen(object userData) - { - req = new ReqPlayerCreate(); - base.OnOpen(userData); - - RespLogin respLogin = userData as RespLogin; - this.m_enter.onClick.Set(OnCreateButtonClick); - req.Id = respLogin.Id; - } - - private async void OnCreateButtonClick() - { - if (m_UserName.text.IsNullOrWhiteSpace()) - { - m_ErrorText.text = "角色名不能为空"; - return; - } - - req.Name = m_UserName.text; - var resp = await GameApp.Network.GetNetworkChannel("network").Call(req); - if (resp.PlayerInfo != null) - { - Log.Info("创建角色成功"); - } - - await GameApp.UI.OpenUIFormAsync(Utility.Asset.Path.GetUIPackagePath(nameof(UILogin)), UIGroupConstants.Floor.Name, UserData, true); - GameApp.UI.CloseUIForm(this); - } - } +using GameFrameX; +#if ENABLE_UI_FAIRYGUI +using GameFrameX.UI.FairyGUI.Runtime; +#endif +using GameFrameX.Runtime; +using GameFrameX.UI.Runtime; +#if ENABLE_UI_UGUI +using GameFrameX.UI.UGUI.Runtime; +#endif +using Hotfix.Proto; + +namespace Hotfix.UI +{ + public partial class UIPlayerCreate + { + ReqPlayerCreate req; + + public override void OnOpen(object userData) + { + req = new ReqPlayerCreate(); + base.OnOpen(userData); + + RespLogin respLogin = userData as RespLogin; + this.m_enter.onClick.Set(OnCreateButtonClick); + req.Id = respLogin.Id; + } + + private async void OnCreateButtonClick() + { + if (m_UserName.text.IsNullOrWhiteSpace()) + { + m_ErrorText.text = "角色名不能为空"; + return; + } + + req.Name = m_UserName.text; + var resp = await GameApp.Network.GetNetworkChannel("network").Call(req); + if (resp.PlayerInfo != null) + { + Log.Info("创建角色成功"); + } + + await GameApp.UI.OpenUIFormAsync(Utility.Asset.Path.GetUIPackagePath(nameof(UILogin)), UIGroupConstants.Floor.Name, UserData, true); + GameApp.UI.CloseUIForm(this); + } + } } \ No newline at end of file diff --git a/Assets/Hotfix/UI/Logic/UILogin/UIPlayerCreate.cs.meta b/Assets/Hotfix/UI/Logic/UILogin/UIPlayerCreate.Logic.cs.meta similarity index 100% rename from Assets/Hotfix/UI/Logic/UILogin/UIPlayerCreate.cs.meta rename to Assets/Hotfix/UI/Logic/UILogin/UIPlayerCreate.Logic.cs.meta diff --git a/Assets/Hotfix/UI/Logic/UILogin/UIPlayerList.cs b/Assets/Hotfix/UI/Logic/UILogin/UIPlayerList.Logic.cs similarity index 97% rename from Assets/Hotfix/UI/Logic/UILogin/UIPlayerList.cs rename to Assets/Hotfix/UI/Logic/UILogin/UIPlayerList.Logic.cs index 1f949e7..5117526 100644 --- a/Assets/Hotfix/UI/Logic/UILogin/UIPlayerList.cs +++ b/Assets/Hotfix/UI/Logic/UILogin/UIPlayerList.Logic.cs @@ -1,110 +1,110 @@ -using System.Collections.Generic; -using FairyGUI; -using GameFrameX.Runtime; -using GameFrameX.UI.Runtime; -#if ENABLE_UI_FAIRYGUI -using GameFrameX.UI.FairyGUI.Runtime; -#endif -#if ENABLE_UI_UGUI -using GameFrameX.UI.UGUI.Runtime; -#endif -using Hotfix.Manager; -using Hotfix.Proto; -using UnityEngine; - -namespace Hotfix.UI -{ - public partial class UIPlayerList - { - List playerList = new List(); - - public override async void OnOpen(object userData) - { - base.OnOpen(userData); - - RespLogin respLogin = userData as RespLogin; - ReqPlayerList req = new ReqPlayerList(); - if (respLogin != null) - { - req.Id = respLogin.Id; - } - -#if ENABLE_UI_FAIRYGUI - this.m_login_button.onClick.Set(OnLoginButtonClick); - this.m_player_list.itemRenderer = ItemRenderer; - this.m_player_list.onClickItem.Set(OnPlayerListItemClick); -#elif ENABLE_UI_UGUI - m_right_Panel.gameObject.SetActive(false); - m_right_Panel__login_button.onClick.Set(OnLoginButtonClick); -#endif - var resp = await GameApp.Network.GetNetworkChannel("network").Call(req); - playerList = resp.PlayerList; -#if ENABLE_UI_UGUI - var uiPlayerListItemAssetHandle = await GameApp.Asset.LoadAssetAsync(Utility.Asset.Path.GetUIPath($"{nameof(UILogin)}/{nameof(UIPlayerListItem)}")); - foreach (var playerInfo in playerList) - { - var item = uiPlayerListItemAssetHandle.InstantiateSync(m_left_Panel__ScrollView__Viewport__Content); - var uiPlayerListItem = item.GetComponent(); - uiPlayerListItem.m_level_text.text = "当前等级:" + playerInfo.Level.ToString(); - uiPlayerListItem.m_name_text.text = playerInfo.Name; - uiPlayerListItem.m_click_Button.onClick.Set(OnPlayerListItemClick, playerInfo); - var assetHandle = await GameApp.Asset.LoadAssetAsync(Utility.Asset.Path.GetCategoryFilePath("Sprites", $"avatar/{PlayerManager.Instance.PlayerInfo.Avatar}")); - uiPlayerListItem.m_icon.sprite = assetHandle.GetAssetObject(); - } -#endif -#if ENABLE_UI_FAIRYGUI - this.m_player_list.numItems = playerList.Count; -#endif - } - - private async void OnLoginButtonClick() - { - ReqPlayerLogin reqPlayerLogin = new ReqPlayerLogin(); - reqPlayerLogin.Id = m_SelectedPlayerInfo.Id; - var respPlayerLogin = await GameApp.Network.GetNetworkChannel("network").Call(reqPlayerLogin); - PlayerManager.Instance.PlayerInfo = respPlayerLogin.PlayerInfo; - await GameApp.UI.OpenFullScreenUIFormAsync(Utility.Asset.Path.GetUIPath(nameof(UIMain)), UIGroupConstants.Floor.Name); - GameApp.UI.CloseUIForm(this); - } - - PlayerInfo m_SelectedPlayerInfo; -#if ENABLE_UI_FAIRYGUI - private void OnPlayerListItemClick(EventContext context) - { - if ((context.data as GComponent).dataSource is PlayerInfo playerInfo) - { - m_SelectedPlayerInfo = playerInfo; - - this.m_selected_icon.icon = UIPackage.GetItemURL(FUIPackage.UICommonAvatar, playerInfo.Avatar.ToString()); - this.m_selected_name.text = playerInfo.Name; - this.m_selected_level.text = "当前等级:" + playerInfo.Level; - this.m_IsSelected.SetSelectedIndex(1); - - } - } -#elif ENABLE_UI_UGUI - private async void OnPlayerListItemClick(object userData) - { - m_SelectedPlayerInfo = (PlayerInfo)userData; - var assetHandle = await GameApp.Asset.LoadAssetAsync(Utility.Asset.Path.GetCategoryFilePath("Sprites", $"avatar/{PlayerManager.Instance.PlayerInfo.Avatar}")); - - m_right_Panel__selected_icon.sprite = assetHandle.GetAssetObject(); - m_right_Panel__selected_name.text = m_SelectedPlayerInfo.Name; - m_right_Panel__selected_level.text = "当前等级:" + m_SelectedPlayerInfo.Level; - m_right_Panel.gameObject.SetActive(true); - } -#endif - private void ItemRenderer(int index, GObject item) - { - var playerInfo = playerList[index]; -#if ENABLE_UI_FAIRYGUI - var uiPlayerListItem = UIPlayerListItem.GetFormPool(item); - uiPlayerListItem.m_level_text.text = "当前等级:" + playerInfo.Level.ToString(); - uiPlayerListItem.m_name_text.text = playerInfo.Name; - uiPlayerListItem.m_icon.icon = UIPackage.GetItemURL(FUIPackage.UICommonAvatar, playerInfo.Avatar.ToString()); -#endif - - item.dataSource = playerInfo; - } - } +using System.Collections.Generic; +using FairyGUI; +using GameFrameX.Runtime; +using GameFrameX.UI.Runtime; +#if ENABLE_UI_FAIRYGUI +using GameFrameX.UI.FairyGUI.Runtime; +#endif +#if ENABLE_UI_UGUI +using GameFrameX.UI.UGUI.Runtime; +#endif +using Hotfix.Manager; +using Hotfix.Proto; +using UnityEngine; + +namespace Hotfix.UI +{ + public partial class UIPlayerList + { + List playerList = new List(); + + public override async void OnOpen(object userData) + { + base.OnOpen(userData); + + RespLogin respLogin = userData as RespLogin; + ReqPlayerList req = new ReqPlayerList(); + if (respLogin != null) + { + req.Id = respLogin.Id; + } + +#if ENABLE_UI_FAIRYGUI + this.m_login_button.onClick.Set(OnLoginButtonClick); + this.m_player_list.itemRenderer = ItemRenderer; + this.m_player_list.onClickItem.Set(OnPlayerListItemClick); +#elif ENABLE_UI_UGUI + m_right_Panel.gameObject.SetActive(false); + m_right_Panel__login_button.onClick.Set(OnLoginButtonClick); +#endif + var resp = await GameApp.Network.GetNetworkChannel("network").Call(req); + playerList = resp.PlayerList; +#if ENABLE_UI_UGUI + var uiPlayerListItemAssetHandle = await GameApp.Asset.LoadAssetAsync(Utility.Asset.Path.GetUIPath($"{nameof(UILogin)}/{nameof(UIPlayerListItem)}")); + foreach (var playerInfo in playerList) + { + var item = uiPlayerListItemAssetHandle.InstantiateSync(m_left_Panel__ScrollView__Viewport__Content); + var uiPlayerListItem = item.GetComponent(); + uiPlayerListItem.m_level_text.text = "当前等级:" + playerInfo.Level.ToString(); + uiPlayerListItem.m_name_text.text = playerInfo.Name; + uiPlayerListItem.m_click_Button.onClick.Set(OnPlayerListItemClick, playerInfo); + var assetHandle = await GameApp.Asset.LoadAssetAsync(Utility.Asset.Path.GetCategoryFilePath("Sprites", $"avatar/{PlayerManager.Instance.PlayerInfo.Avatar}")); + uiPlayerListItem.m_icon.sprite = assetHandle.GetAssetObject(); + } +#endif +#if ENABLE_UI_FAIRYGUI + this.m_player_list.numItems = playerList.Count; +#endif + } + + private async void OnLoginButtonClick() + { + ReqPlayerLogin reqPlayerLogin = new ReqPlayerLogin(); + reqPlayerLogin.Id = m_SelectedPlayerInfo.Id; + var respPlayerLogin = await GameApp.Network.GetNetworkChannel("network").Call(reqPlayerLogin); + PlayerManager.Instance.PlayerInfo = respPlayerLogin.PlayerInfo; + await GameApp.UI.OpenFullScreenUIFormAsync(Utility.Asset.Path.GetUIPath(nameof(UIMain)), UIGroupConstants.Floor.Name); + GameApp.UI.CloseUIForm(this); + } + + PlayerInfo m_SelectedPlayerInfo; +#if ENABLE_UI_FAIRYGUI + private void OnPlayerListItemClick(EventContext context) + { + if ((context.data as GComponent).dataSource is PlayerInfo playerInfo) + { + m_SelectedPlayerInfo = playerInfo; + + this.m_selected_icon.icon = UIPackage.GetItemURL(FUIPackage.UICommonAvatar, playerInfo.Avatar.ToString()); + this.m_selected_name.text = playerInfo.Name; + this.m_selected_level.text = "当前等级:" + playerInfo.Level; + this.m_IsSelected.SetSelectedIndex(1); + + } + } +#elif ENABLE_UI_UGUI + private async void OnPlayerListItemClick(object userData) + { + m_SelectedPlayerInfo = (PlayerInfo)userData; + var assetHandle = await GameApp.Asset.LoadAssetAsync(Utility.Asset.Path.GetCategoryFilePath("Sprites", $"avatar/{PlayerManager.Instance.PlayerInfo.Avatar}")); + + m_right_Panel__selected_icon.sprite = assetHandle.GetAssetObject(); + m_right_Panel__selected_name.text = m_SelectedPlayerInfo.Name; + m_right_Panel__selected_level.text = "当前等级:" + m_SelectedPlayerInfo.Level; + m_right_Panel.gameObject.SetActive(true); + } +#endif + private void ItemRenderer(int index, GObject item) + { + var playerInfo = playerList[index]; +#if ENABLE_UI_FAIRYGUI + var uiPlayerListItem = UIPlayerListItem.GetFormPool(item); + uiPlayerListItem.m_level_text.text = "当前等级:" + playerInfo.Level.ToString(); + uiPlayerListItem.m_name_text.text = playerInfo.Name; + uiPlayerListItem.m_icon.icon = UIPackage.GetItemURL(FUIPackage.UICommonAvatar, playerInfo.Avatar.ToString()); +#endif + + item.dataSource = playerInfo; + } + } } \ No newline at end of file diff --git a/Assets/Hotfix/UI/Logic/UILogin/UIPlayerList.cs.meta b/Assets/Hotfix/UI/Logic/UILogin/UIPlayerList.Logic.cs.meta similarity index 100% rename from Assets/Hotfix/UI/Logic/UILogin/UIPlayerList.cs.meta rename to Assets/Hotfix/UI/Logic/UILogin/UIPlayerList.Logic.cs.meta diff --git a/Assets/Hotfix/UI/Logic/UIMain/UIMain.cs b/Assets/Hotfix/UI/Logic/UIMain/UIMain.Logic.cs similarity index 100% rename from Assets/Hotfix/UI/Logic/UIMain/UIMain.cs rename to Assets/Hotfix/UI/Logic/UIMain/UIMain.Logic.cs diff --git a/Assets/Hotfix/UI/Logic/UIMain/UIMain.cs.meta b/Assets/Hotfix/UI/Logic/UIMain/UIMain.Logic.cs.meta similarity index 100% rename from Assets/Hotfix/UI/Logic/UIMain/UIMain.cs.meta rename to Assets/Hotfix/UI/Logic/UIMain/UIMain.Logic.cs.meta