chenxin
2020-12-25 6baa5a654138a2e0a9871adaef311a74e132dd6e
Assets/Scripts/UI/Main/MainStartUI.cs
New file
@@ -0,0 +1,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);
    }
}