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

    }
}
相关推荐
相信神话202114 小时前
第四章:Godot 4.6 核心概念与开发环境搭建
游戏引擎·godot·2d游戏编程·godot4·2d游戏开发
代数狂人14 小时前
在Godot中应用面向对象原则:C#脚本实践
c#·游戏引擎·godot
Sator117 小时前
Unity关于射击游戏人物动画的设计经验
游戏·unity·游戏引擎
冰凌糕17 小时前
Unity3D Shader 坐标空间详解
unity
风酥糖1 天前
Godot游戏练习01-第20节-增加亿点点细节
游戏·游戏引擎·godot
智算菩萨1 天前
【OpenGL】6 真实感光照渲染实战:Phong模型、材质系统与PBR基础
开发语言·python·游戏引擎·游戏程序·pygame·材质·opengl
心前阳光2 天前
Unity之ScrollRect简易实现
unity·游戏引擎
WarrenMondeville2 天前
9.Unity面向对象-对象池
unity
KaGme2 天前
生成3DGS场景在unity中的呈现
3d·unity·游戏引擎
zyh______2 天前
关于unity的序列化
unity·游戏引擎