当前位置:网站首页>FairyGUI复选框与进度条的组合使用
FairyGUI复选框与进度条的组合使用
2022-07-06 09:18:00 【SQ刘】
FairyGUI复选框与进度条的组合使用
一、准备工作
1、新建包ProgressBar
可以在上一个案例的基础上接着新建包。
2、新建组件
3、导入素材
二、进度条
1、新建进度条
2、微调进度条
3、进度条跟跑动画
为了使进度条不那么单调,可以给它添加一个动画。让进度条伸缩的时候,松鼠跟着进度条的增加往右移。也就是有那么一个跟跑的效果,看起来更生动。
设置关联
三、下拉框
1、新建下拉框
2、设置下拉框
3、下拉框完成效果
四、打包发布
五、Unity中显示
六、编码实现
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FairyGUI;
using System;
public class ProgressBar : MonoBehaviour
{
private GComponent mainUI;
private GProgressBar progressBar;
private GComboBox comboBox;
void Start()
{
mainUI = GetComponent<UIPanel>().ui;
progressBar = mainUI.GetChild("n0").asProgress;
progressBar.TweenValue(100, 5); //100是要加载的进度,5是需要花费的时间
comboBox = mainUI.GetChild("n4").asComboBox;
comboBox.onChanged.Add(SetCompleteTime);
}
private void SetCompleteTime()
{
progressBar.value = 0; //每次重新加载将它的进度设置为0
progressBar.TweenValue(100, Convert.ToInt32(comboBox.value));
}
}
七、最终效果
边栏推荐
- (课设第一套)1-4 消息传递接口 (100 分)(模拟:线程)
- Redis 缓存更新策略,缓存穿透、雪崩、击穿问题
- Gateway fails to route according to the service name, and reports an error service unavailable, status=503
- [Offer29] 排序的循环链表
- [leetcode19]删除链表中倒数第n个结点
- 1041 Be Unique (20 point(s))(哈希:找第一个出现一次的数)
- 燕山大学校园网自动登录问题解决方案
- Working principle of genius telephone watch Z3
- Postman 中级使用教程【环境变量、测试脚本、断言、接口文档等】
- [Offer18]删除链表的节点
猜你喜欢
Compilation principle: preprocessing of source program and design and implementation of lexical analysis program (including code)
Problèmes avec MySQL time, fuseau horaire, remplissage automatique 0
Arduino JSON data information parsing
Common properties of location
First use of dosbox
Esp8266 uses Arduino to connect Alibaba cloud Internet of things
Unity3D制作注册登录界面,并实现场景跳转
Intermediate use tutorial of postman [environment variables, test scripts, assertions, interface documents, etc.]
open-mmlab labelImg mmdetection
Remember an experience of ECS being blown up by passwords - closing a small black house, changing passwords, and changing ports
随机推荐
level16
Knowledge summary of request
Embedded startup process
(四)R语言的数据可视化——矩阵图、柱状图、饼图、散点图与线性回归、带状图
(三)R语言的生物信息学入门——Function, data.frame, 简单DNA读取与分析
[offer29] sorted circular linked list
[leetcode622] design circular queue
. elf . map . list . Hex file
Basic operations of databases and tables ----- creating data tables
Page performance optimization of video scene
Programming homework: educational administration management system (C language)
@Autowired 和 @Resource 的区别
(课设第一套)1-4 消息传递接口 (100 分)(模拟:线程)
SSD technical features
Remember an experience of ECS being blown up by passwords - closing a small black house, changing passwords, and changing ports
燕山大学校园网自动登录问题解决方案
Cannot change version of project facet Dynamic Web Module to 2.3.
dosbox第一次使用
JS变量类型以及常用类型转换
Single chip Bluetooth wireless burning