unity3d——基础篇小项目(开始界面)

示例代码:

cs 复制代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BeginPanel : BasePanel<BeginPanel>
{
    public UIButton btnBegin;
    public UIButton btnRank;
    public UIButton btnSetting;
    public UIButton btnQuit;    
    protected override void Init()
    {
        btnBegin.onClick.Add(new EventDelegate ( () => 
        {
            //显示武器面板
            print("选角");
            //隐藏自己
            HideMe();
        }));

        btnRank.onClick.Add(new EventDelegate(() =>
        {
            //显示排行榜
            print("排行榜");
        }));

        btnSetting.onClick.Add(new EventDelegate(() =>
        {
            //显示设置面板
            print("设置");
        }));

        btnQuit.onClick.Add(new EventDelegate(() =>
        {
            //退出游戏
            print("退出");
            Application.Quit();
        }));

    }
}
相关推荐
℡枫叶℡10 小时前
Unity - Import Activity Window 资源导入诊断信息窗口
unity·资源导入诊断
TO_ZRG12 小时前
Unity 证书校验
unity·游戏引擎
mxwin14 小时前
Unity Shader 切线空间数据是如何计算出来的
unity·游戏引擎·shader
mxwin17 小时前
Unity Shader 法线贴图跟切线空间有什么关系
unity·游戏引擎·贴图·shader
mxwin17 小时前
Unity Shader 贴图和采样的关系 如何保证贴图清晰
unity·游戏引擎·贴图·shader
心前阳光19 小时前
Unity之使用火山引擎实现文字提问流式回复
unity·游戏引擎·火山引擎
mxwin1 天前
Unity Shader 什么是球谐光照 原理是什么
unity·游戏引擎·shader
心前阳光1 天前
Unity之使用火山引擎实现语音识别
unity·语音识别·火山引擎
心前阳光1 天前
Unity之使用火山引擎实现流式语音合成
unity·游戏引擎·火山引擎