备份CatanBuilding瘦身独立工程
This commit is contained in:
47
Assets/Scripts/UI/Social/ClubQuitNoticePopupPanel.cs
Normal file
47
Assets/Scripts/UI/Social/ClubQuitNoticePopupPanel.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using asap.core;
|
||||
using game;
|
||||
using GameCore;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ClubQuitNoticePopupPanel : MonoBehaviour
|
||||
{
|
||||
Button btn_close;
|
||||
Button btn_leave;
|
||||
Button btn_choose;
|
||||
ClubService clubService;
|
||||
private void Awake()
|
||||
{
|
||||
btn_close = transform.Find("btn_close").GetComponent<Button>();
|
||||
btn_leave = transform.Find("root/btn_leave/btn_green").GetComponent<Button>();
|
||||
btn_choose = transform.Find("root/btn_choose/btn_green").GetComponent<Button>();
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
clubService = GContext.container.Resolve<ClubService>();
|
||||
btn_leave.onClick.AddListener(OnLeave);
|
||||
btn_choose.onClick.AddListener(OnChoose);
|
||||
btn_close.onClick.AddListener(ClosePanel);
|
||||
bool showChoose = clubService.memberRole == EMemberRole.Owner && clubService.myClubInfo.curMembers > 1;
|
||||
btn_leave.gameObject.SetActive(!showChoose);
|
||||
btn_choose.gameObject.SetActive(showChoose);
|
||||
}
|
||||
void OnLeave()
|
||||
{
|
||||
btn_leave.enabled = false;
|
||||
clubService.QuitClub();
|
||||
ClosePanel();
|
||||
}
|
||||
async void OnChoose()
|
||||
{
|
||||
btn_close.enabled = false;
|
||||
ClosePanel();
|
||||
await UIManager.Instance.ShowUI(UITypes.ClubChooseHeirPopupPanel);
|
||||
}
|
||||
void ClosePanel()
|
||||
{
|
||||
UIManager.Instance.DestroyUI(UITypes.ClubQuitNoticePopupPanel);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user