首页 > 学院 > 开发设计 > 正文

UI框架之-----界面逻辑面板

2019-11-09 13:45:24
字体:
来源:转载
供稿:网友
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("游戏介绍按钮");    }}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表