当前位置:网站首页>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));
}
}
七、最终效果
边栏推荐
- VSCode基础配置
- Minio文件下载问题——inputstream:closed
- Gravure sans fil Bluetooth sur micro - ordinateur à puce unique
- ESP learning problem record
- Imgcat usage experience
- Unity场景跳转及退出
- JS regular expression basic knowledge learning
- Compilation principle: preprocessing of source program and design and implementation of lexical analysis program (including code)
- [Offer18]删除链表的节点
- Programmers can make mistakes. Basic pointers and arrays of C language
猜你喜欢
open-mmlab labelImg mmdetection
CUDA C programming authoritative guide Grossman Chapter 4 global memory
Stm32f1+bc20+mqtt+freertos system is connected to Alibaba cloud to transmit temperature and humidity and control LED lights
2021.11.10汇编考试
Latex learning
基于Redis的分布式ID生成器
JS變量類型以及常用類型轉換
ORA-02030: can only select from fixed tables/views
(5) Introduction to R language bioinformatics -- ORF and sequence analysis
idea问题记录
随机推荐
SVN更新后不出现红色感叹号
dosbox第一次使用
Unity3d camera, the keyboard controls the front and rear left and right up and down movement, and the mouse controls the rotation, zoom in and out
[Offer18]删除链表的节点
[Offer29] 排序的循环链表
Classification, understanding and application of common methods of JS array
JS数组常用方法的分类、理解和运用
Redis 缓存更新策略,缓存穿透、雪崩、击穿问题
Unity场景跳转及退出
ES6 grammar summary -- Part I (basic)
记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口
(1) Introduction Guide to R language - the first step of data analysis
First use of dosbox
Esp8266 uses Arduino to connect Alibaba cloud Internet of things
编译原理:源程序的预处理及词法分析程序的设计与实现(含代码)
1041 Be Unique (20 point(s))(哈希:找第一个出现一次的数)
Custom view puzzle getcolor r.color The color obtained by colorprimary is incorrect
Easy to use shortcut keys in idea
Single chip Bluetooth wireless burning
Working principle of genius telephone watch Z3