当前位置:网站首页>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));
}
}
七、最终效果




边栏推荐
- idea中导包方法
- JS function promotion and declaration promotion of VaR variable
- C programming exercise
- Basic operations of databases and tables ----- creating data tables
- Common DOS commands
- [Offer18]删除链表的节点
- MySQL takes up too much memory solution
- 1041 be unique (20 points (s)) (hash: find the first number that occurs once)
- Unity3D制作注册登录界面,并实现场景跳转
- [offer78] merge multiple ordered linked lists
猜你喜欢
![[Red Treasure Book Notes simplified version] Chapter 12 BOM](/img/ff/0ad410b5b556c0e16a4076a2a0577b.jpg)
[Red Treasure Book Notes simplified version] Chapter 12 BOM

Symbolic representation of functions in deep learning papers
![[golang] leetcode intermediate - fill in the next right node pointer of each node & the k-smallest element in the binary search tree](/img/6e/0802a92511ac50a652afa1678ad28c.jpg)
[golang] leetcode intermediate - fill in the next right node pointer of each node & the k-smallest element in the binary search tree

The dolphin scheduler remotely executes shell scripts through the expect command

Basic operations of databases and tables ----- creating data tables

基于Redis的分布式锁 以及 超详细的改进思路

Database course design: college educational administration management system (including code)

Générateur d'identification distribué basé sur redis

(五)R语言入门生物信息学——ORF和序列分析

Navigator object (determine browser type)
随机推荐
[Offer29] 排序的循环链表
PT OSC deadlock analysis
Programmers can make mistakes. Basic pointers and arrays of C language
Expected value (EV)
(三)R语言的生物信息学入门——Function, data.frame, 简单DNA读取与分析
js 变量作用域和函数的学习笔记
[leetcode19] delete the penultimate node in the linked list
[leetcode15] sum of three numbers
js题目:输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组。
Idea problem record
(一)R语言入门指南——数据分析的第一步
关于Gateway中使用@Controller的问题
Cannot change version of project facet Dynamic Web Module to 2.3.
ESP8266连接onenet(旧版MQTT方式)
Esp8266 connects to onenet cloud platform (mqtt) through Arduino IDE
Page performance optimization of video scene
Gateway fails to route according to the service name, and reports an error service unavailable, status=503
[leetcode622]设计循环队列
[esp32 learning-1] construction of Arduino esp32 development environment
[Clickhouse kernel principle graphic explanation] about the collaborative work of partitioning, indexing, marking and compressed data
