From 6baa5a654138a2e0a9871adaef311a74e132dd6e Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Fri, 25 Dec 2020 15:53:56 +0800 Subject: [PATCH] Merge branch 'master' of http://47.95.218.140:8090/r/GemBattle into master --- Assets/Scripts/UI/Main/MainStartUI.cs | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/Assets/Scripts/UI/Main/MainStartUI.cs b/Assets/Scripts/UI/Main/MainStartUI.cs new file mode 100644 index 0000000..354fdb1 --- /dev/null +++ b/Assets/Scripts/UI/Main/MainStartUI.cs @@ -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); + } +} -- Gitblit v1.9.1