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();
        }));

    }
}
相关推荐
winlife_3 小时前
Unity 域重载会清空一切:Editor 工具如何让状态在重载后续命
unity·游戏引擎
深度森林5 小时前
无人机“路径规划”高价值专利案例:基于抗干扰粒子群优化的无人机路径规划方法
游戏引擎·cocos2d
小贺儿开发5 小时前
Unity3D 串口通信上位机联调系统
unity·串口·协议·数据·通信·传输·互动
tedcloud1237 小时前
ppt-master部署教程:快速搭建智能演示文稿系统
服务器·人工智能·系统架构·游戏引擎·powerpoint
垂葛酒肝汤1 天前
Unity的UI扫光效果Shader
ui·unity·游戏引擎
mxwin1 天前
Unity Shader Alpha测试 · 模板测试 · 深度测试
unity·游戏引擎
2601_956002811 天前
冬日狂想曲(赠去马赛克补丁)2026.5.13最新版免费下载 转存后自动更新 (看到请立即转存 资源随时失效)pc手机版通用
智能手机·游戏引擎·电脑·游戏程序·动画·游戏美术
Sator11 天前
unity解决粒子与物体接触时的硬边缘问题
unity·游戏引擎
RPGMZ2 天前
RPGMZ NPC头顶自动显示一段消息
前端·游戏引擎·rpgmz·rpgmakermz
程序员JerrySUN2 天前
Jetson边缘嵌入式实战课程第三讲:L4T 与 Jetson 系统架构
linux·服务器·人工智能·安全·unity·系统架构·游戏引擎