New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using KTGMGemClient; |
| | | public class MainStartUI : MonoBehaviour |
| | | { |
| | | private Button pvpPanel; |
| | | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | { |
| | | transform.Find("GoToBattleBtn").GetComponent<Button>().onClick.AddListener(OnClickGoToBattleBtn); |
| | | transform.Find("ShowPVPBtn").GetComponent<Button>().onClick.AddListener(OnClickShowPVPBtn); |
| | | |
| | | pvpPanel = transform.Find("PVPPanel").GetComponent<Button>(); |
| | | pvpPanel.onClick.AddListener(OnClickPVPPanelBtn); |
| | | pvpPanel.gameObject.SetActive(false); |
| | | } |
| | | |
| | | private void OnClickGoToBattleBtn() |
| | | { |
| | | //跳转场景 |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.ChangeScene); |
| | | gameObject.SetActive(false); |
| | | |
| | | //transform.parent.GetComponent<Loading>().StartLoadingScene(); |
| | | } |
| | | private void OnClickShowPVPBtn() |
| | | { |
| | | pvpPanel.gameObject.SetActive(true); |
| | | } |
| | | |
| | | private void OnClickPVPPanelBtn() |
| | | { |
| | | pvpPanel.gameObject.SetActive(false); |
| | | } |
| | | } |