chenxin
2020-12-25 6baa5a654138a2e0a9871adaef311a74e132dd6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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);
    }
}