using UnityEngine;using System.Collections;using UnityEngine.UI;public class TitlePanel : PanelBase { PRivate Button startBtn; private Button infoBtn; public override void Init(params object[] args) { base.Init(args); skinPath = "TitlePanel"; layer = PanelLayer.Panel; } public override void OnShowing() { base.OnShowing(); Transform skinTrans = skin.transform; startBtn = skinTrans.transform.Find("StartBtn").GetComponent<Button>(); infoBtn = skinTrans.transform.Find("InfoBtn").GetComponent<Button>(); startBtn.onClick.AddListener(OnStartClick); infoBtn.onClick.AddListener(OnInfoClick); } public void OnStartClick() { print("开始按钮"); } public void OnInfoClick() { print("游戏介绍按钮"); }}
新闻热点
疑难解答