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

    }
}
相关推荐
timathy3315 小时前
Unity Addressable 实现Build时自定义剔除资源组
unity·游戏引擎
一种时光1 天前
Unity 获取当前播放的动画,判断是否是某个动画
unity·游戏引擎
速冻鱼Kiel1 天前
Lyra的相机系统
笔记·ue5·游戏引擎·虚幻
不绝1912 天前
Unity入门 :场景叠加/预制体资源包/脚本资源/生命周期函数/Inspector页面
unity·游戏引擎
在路上看风景2 天前
20. 资源和脚本的绑定关系
unity
yj爆裂鼓手2 天前
unity对象池
unity·c#
在路上看风景2 天前
3.7 SRP Batcher
unity
快乐觉主吖2 天前
Unity方便修改产品名和包名的小工具
unity·游戏引擎
孟无岐2 天前
【Laya】HttpRequest 网络请求
网络·typescript·游戏引擎·游戏程序·laya
JIes__2 天前
Unity(二)——MonoBehavior中的重要内容
unity·游戏引擎