| | |
| | | using System.Collections; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | /// <summary> |
| | | /// 加入公会界面 :公会查找列表,也是排行榜 |
| | |
| | | [SerializeField] Button quicklyJoinGuildBtn; |
| | | [SerializeField] ScrollerController guildListScroller; |
| | | [SerializeField] Transform noGuildTf; |
| | | [SerializeField] Button serversBtn; |
| | | |
| | | string lastQuery = ""; |
| | | int lastPage = 0; |
| | |
| | | findBtn.AddListener(() => OnFindBtnClick()); |
| | | createGuildBtn.AddListener(OnCreateGuildBtnClick); |
| | | quicklyJoinGuildBtn.AddListener(OnQuicklyJoinGuildBtnClick); |
| | | serversBtn.AddListener(()=> |
| | | { |
| | | UIHelper.ShowServersPanel(GuildManager.Instance.crossServerIDList); |
| | | }); |
| | | } |
| | | protected override void OnPreOpen() |
| | | { |
| | |
| | | guildListScroller.OnRefreshCell -= RefreshCell; |
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo -= OnRefreshFairyInfo; |
| | | |
| | | var win = UIManager.Instance.GetUI<MainWin>(); |
| | | if (win) |
| | | win.RestoreFuncBtn(); |
| | | |
| | | UIManager.Instance.GetUI<MainWin>()?.RestoreFuncBtn(); |
| | | |
| | | } |
| | | |
| | | void OnRefreshFairyInfo() |
| | | { |
| | | //当前界面下有刷新自家的公会数据,说明一定是加入了公会,需主动跳转到公会界面 |
| | | CloseWindow(); |
| | | var win = UIManager.Instance.GetUI<MainWin>(); |
| | | if (win) |
| | | win.ClickFunc(4); |
| | | UIManager.Instance.GetUI<MainWin>()?.ClickFunc(4); |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | | serversBtn.SetActive(GuildManager.Instance.zoneID != 0); |
| | | CreateScroller(); |
| | | } |
| | | |
| | |
| | | noGuildTf.SetActive(false); |
| | | guildListScroller.SetActive(true); |
| | | |
| | | var startCount = guildListScroller.GetNumberOfCells(); |
| | | var startCount = guildListScroller.GetCellTotalCount(); |
| | | if (startCount > GuildManager.Instance.pageIndexList.Count) |
| | | { |
| | | guildListScroller.Refresh(); |
| | |
| | | |
| | | private void OnCreateGuildBtnClick() |
| | | { |
| | | UIManager.Instance.OpenWindow<GuildCreateWin>(); |
| | | UIManager.Instance.OpenWindowAsync<GuildCreateWin>().Forget(); |
| | | } |
| | | |
| | | private void OnQuicklyJoinGuildBtnClick() |