当前位置:网站首页>GameFramework制作游戏(二)制作UI界面
GameFramework制作游戏(二)制作UI界面
2022-07-25 14:24:00 【AT巡礼】
1.制作UI界面

我做了个动画,然后把场景内的UI预制体删了
开始做加载资源里的UI预制体
返回我们的Demo11_Meun脚本,添加逻辑
public class Demo11_Meun : ProcedureBase
{
protected override void OnEnter(ProcedureOwner procedureOwner)
{
base.OnEnter(procedureOwner);
UIComponent UI = UnityGameFramework.Runtime.GameEntry.GetComponent<UIComponent>();//获取UI组件,跟Scence一样,其实就是下面的组件“UI”
// 加载UI
UI.OpenUIForm("Assets/Demo11/MenuPanel.prefab","The_One");//我们要把创建出来的预制体放到一个父物体,我们起名叫The_One
}
}
然后如下图,就相当于自动生成了一个父物体
运行会报错,因为为缺少UI的逻辑处理脚本
所以还需要给MenuPanel预制体添加上UI脚本,创建MenuPanel.cs脚本,记得挂到预制体上
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityGameFramework.Runtime;public class MenuPanel : UIFormLogic//必须继承这个
{
}
运行,就可以看到UI了,如下图
看过文章的都知道,如果我点了中间的按钮,那么会跳到Game场景,如下图
会发现UI没有消失
这是因为UI在初始场景中,也就是在下面这里第一个流程
那我们要的是让他消失,就把UI放到Menu场景中就可以了,连生成都不需要
但是需要自己写个Controller脚本,跟我们做跳转场景的一样。
边栏推荐
- Feiwo technology IPO meeting: annual revenue of 1.13 billion Hunan Cultural Tourism and Yuanli investment are shareholders
- Initial flask and simple application
- 基于浏览器的分屏阅读
- Practical guide for network security emergency response technology (Qianxin)
- ~5 new solution of CCF 2021-12-2 sequence query
- Melodic + Realsense D435i 配置及错误问题解决
- Summary of some problems about left value and right value [easy to understand]
- Filters get the data in data; Filters use data in data
- A small part is exposed on one or both sides of the swiper
- Nuc980 set up SSH xshell connection
猜你喜欢
Famous handwritten note taking software recruit CTO · coordinate Shenzhen

51单片机学习笔记(1)

苹果官网产品打折 买iPhone 13 Pro Max 可省600元

2271. Maximum number of white bricks covered by blanket ●●

疫情之下,生物医药行业或将迎来突破性发展

Interpretation of featdepth self-monitoring model for monocular depth estimation (Part 2) -- use of openmmlab framework

sudo rosdep init Error ROS安装问题解决方案

~4.1 sword finger offer 05. replace spaces

Mysql表的操作

It is predicted that 2021 will accelerate the achievement of super automation beyond RPA
随机推荐
AI model risk assessment Part 1: motivation
Cologne new energy IPO was terminated: the advanced manufacturing and Zhanxin fund to be raised is the shareholder
VS2017大型工厂ERP管理系统源码 工厂通用ERP源码
From fish eye to look around to multi task King bombing -- a review of Valeo's classic articles on visual depth estimation (from fisheyedistancenet to omnidet) (Part I)
阿里云安装MYSQL5.7
疫情之下,生物医药行业或将迎来突破性发展
金鱼哥RHCA回忆录:CL210管理存储--对象存储
Resource not found: rgbd_launch 解决方案
Pytorch uses tensorboard to realize visual summary
sudo rosdep init Error ROS安装问题解决方案
Gateway 网关报错 SERVICE_UNAVAILABLE
Emergency science | put away this summer safety guide and let children spend the summer vacation safely!
Realize a family security and environmental monitoring system (I)
CTS测试介绍(面试怎么介绍接口测试)
Doris learning notes integration with other systems
Word set paste to retain only text
Mysql表的操作
Detailed explanation of nat/napt address translation (internal and external network communication) technology [Huawei ENSP]
Introducing mlops interpretation (I)
Detailed explanation of Telnet remote login AAA mode [Huawei ENSP]