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

    }
}
相关推荐
Tech Synapse28 分钟前
数字孪生工厂实战指南:基于Unreal Engine/Omniverse的虚实同步系统开发
游戏引擎·linq·虚幻
驰愿2 小时前
ET EntityRef EntityWeakRef 类分析
unity·et
敲代码的 蜡笔小新10 小时前
【行为型之中介者模式】游戏开发实战——Unity复杂系统协调与通信架构的核心秘诀
unity·设计模式·c#·中介者模式
敲代码的 蜡笔小新12 小时前
【行为型之解释器模式】游戏开发实战——Unity动态公式解析与脚本系统的架构奥秘
unity·设计模式·游戏引擎·解释器模式
Magnum Lehar15 小时前
3d游戏引擎的Utilities模块实现
c++·算法·游戏引擎
敲代码的 蜡笔小新16 小时前
【行为型之观察者模式】游戏开发实战——Unity事件驱动架构的核心实现策略
观察者模式·unity·设计模式·c#
向宇it16 小时前
【unity游戏开发——编辑器扩展】使用EditorGUI的EditorGUILayout绘制工具类在自定义编辑器窗口绘制各种UI控件
开发语言·ui·unity·c#·编辑器·游戏引擎
qq_2052790520 小时前
unity 鼠标更换指定图标
unity·游戏引擎
虾球xz20 小时前
游戏引擎学习第279天:将实体存储移入世界区块
c++·学习·游戏引擎
虾球xz1 天前
游戏引擎学习第278天:将实体存储移入世界区块
数据库·c++·学习·游戏引擎