当前位置:网站首页>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脚本,跟我们做跳转场景的一样。
边栏推荐
- RuntimeError: CUDA out of memory(已解决)[通俗易懂]
- Okaleido ecological core equity Oka, all in fusion mining mode
- [original] nine point calibration tool for robot head camera calibration
- Under the epidemic, the biomedical industry may usher in breakthrough development
- jqgrid全选取消单行点击取消事件
- Matplotlib data visualization three minutes entry, half an hour enchanted?
- Bond0 script
- 华为ensp路由器静态路由(默认路由的下一跳地址)
- Mongodb source code deployment and configuration
- Polymorphism and interface
猜你喜欢

Interpretation of featdepth self-monitoring model for monocular depth estimation (Part I) -- paper understanding and core source code analysis

What you must know about data engineering in mlops
![[directory blasting tool] information collection stage: robots.txt, Yujian, dirsearch, dirb, gobuster](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[directory blasting tool] information collection stage: robots.txt, Yujian, dirsearch, dirb, gobuster

Digital Twins - cognition

PS制作加载GIF图片教程

sqli-labs Basic Challenges Less1-10

IDEA报错 Failed to determine a suitable driver class

科隆新能源IPO被终止:拟募资6亿 先进制造与战新基金是股东

The security market has entered a trillion era, and the security B2B online mall platform has been accurately connected to deepen the enterprise development path

Feiwo technology IPO meeting: annual revenue of 1.13 billion Hunan Cultural Tourism and Yuanli investment are shareholders
随机推荐
阿里云安装MYSQL5.7
Two Sum
Gateway reports an error service_ UNAVAILABLE
Cologne new energy IPO was terminated: the advanced manufacturing and Zhanxin fund to be raised is the shareholder
如何设计一个高并发系统?
Huawei ENSP router static route (the next hop address of the default route)
The practice of depth estimation self-monitoring model monodepth2 in its own data set -- single card / multi card training, reasoning, onnx transformation and quantitative index evaluation
From Anaconda to tensorflow to jupyter, step on the pit and fill it all the way
CDA level Ⅰ 2021 new version simulation question 1 (with answers)
Opencv video tracking "suggestions collection"
Realize a family security and environmental monitoring system (II)
How to design a high concurrency system?
Goldfish rhca memoirs: cl210 management storage -- object storage
Data analysis interview records 1-5
Numpy basic package for data analysis
2271. Maximum number of white bricks covered by blanket ●●
Reverse Integer
Paddlenlp之UIE关系抽取模型【高管关系抽取为例】
jqgrid全选取消单行点击取消事件
苹果手机端同步不成功,退出登录,结果再也登录不了