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

    }
}
相关推荐
爱搞虚幻的阿恺4 天前
Niagara粒子系统-超炫酷的闪电特效(加餐 纸牌螺旋上升效果)
游戏·游戏引擎
_Li.4 天前
Simulink - 6DOF (Euler Angles)
人工智能·算法·机器学习·游戏引擎·cocos2d
weixin_424294674 天前
Unity 调用Steamworks API 的 SteamUserStats.RequestCurrentStats()报错
unity·游戏引擎·steamwork
HoFunGames4 天前
Unity小地图,Easy Minimap System MT-GPS插件
unity·游戏引擎
wy3258643644 天前
Unity 新输入系统InputSystem(基本操作)
unity·c#·游戏引擎
WarPigs4 天前
着色器multi_compile笔记
unity·着色器
ECHO飞跃 0124 天前
Unity2019 本地推理 通义千问0.5-1.5B微调导入
人工智能·深度学习·unity·llama
Unity游戏资源学习屋4 天前
【Unity UI资源包】GUI Pro - Casual Game 专为休闲手游打造的专业级UI资源包
ui·unity
冰凌糕4 天前
Unity3D Shader 顶点法线外扩实现描边效果
unity
星和月4 天前
Untiy使用说明
c#·游戏引擎