123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using ET;
- using FairyGUI;
- using UI.League;
- using UnityEngine;
- namespace GFGGame
- {
- //联盟成员管理
- public class LeagueMemberAppointView : BaseWindow
- {
- private UI_LeagueMemberAppointUI _ui;
- private LeagueMemberData _memberData;
- public override void Dispose()
- {
- if (_ui != null)
- {
- _ui.Dispose();
- _ui = null;
- }
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_LeagueMemberAppointUI.PACKAGE_NAME;
- _ui = UI_LeagueMemberAppointUI.Create();
- this.viewCom = _ui.target;
- this.viewCom.Center();
- this.modal = true;
- viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
- _ui.m_btnRule.onClick.Add(OnBtnRuleClick);
- _ui.m_btnKick.onClick.Add(OnBtnKickClick);
- _ui.m_btnAppoint0.onClick.Add(OnBtnAppointClick);
- _ui.m_btnAppoint0.data = LeaguePos.Owner;
- _ui.m_btnAppoint1.onClick.Add(OnBtnAppointClick);
- _ui.m_btnAppoint1.data = LeaguePos.SubOwner;
- _ui.m_btnAppoint2.onClick.Add(OnBtnAppointClick);
- _ui.m_btnAppoint2.data = LeaguePos.Flower;
- }
- protected override void AddEventListener()
- {
- base.AddEventListener();
- }
- protected override void OnShown()
- {
- base.OnShown();
- _memberData = this.viewData as LeagueMemberData;
- }
- protected override void OnHide()
- {
- base.OnHide();
- }
- protected override void RemoveEventListener()
- {
- base.RemoveEventListener();
- }
- private void OnBtnRuleClick()
- {
- ViewManager.Show<RuleView>();
- }
- private void OnBtnKickClick()
- {
- AlertUI.Show("是否确认请离这个小伙伴")
- .SetLeftButton(true, "取消")
- .SetRightButton(true, "确认", async (object param) =>
- {
- bool result = await LeagueSproxy.ReqKickLeague(_memberData.RoleInfo.roleId);
- if (result)
- {
- Hide();
- }
- });
- }
- private void OnBtnAppointClick()
- {
- }
- private void UpdateView()
- {
- _ui.m_c1.selectedIndex = LeagueDataManager.Instance.LeagueData.LeagueMemberDatas[RoleDataManager.roleId].Pos == LeaguePos.Owner ? 1 : 0;
- _ui.m_btnAppoint0.title = "1/1";
- _ui.m_btnAppoint1.touchable = LeagueDataManager.Instance.LeagueData.SubOwnerId == 0 ? true : false;
- _ui.m_btnAppoint1.title = LeagueDataManager.Instance.LeagueData.SubOwnerId == 0 ? "0/1" : "1/1";
- _ui.m_btnAppoint2.touchable = LeagueDataManager.Instance.LeagueData.SubOwnerId == 0 ? true : false;
- }
- }
- }
|