当前位置:网站首页>Unity Odin ProgressBar add value column
Unity Odin ProgressBar add value column
2022-04-23 20:34:00 【One Mr rabbit one】
Unity plug-in unit Odin Provides properties for displaying progress bars [ProgressBar], But the default is not to display the value column , You can customize and modify some scripts and add value Columns ;
Odin The use of BaseProgressBarAttributeDrawer<T> To handle multiple types of progress bars
public class ProgressBarAttributeIntWithValueDrawer : BaseProgressBarAttributeDrawer<int>
{
protected override int DrawProgressBar(Rect rect, GUIContent label, double min, double max, ProgressBarConfig config, string valueLabel)
{
rect.width -= 60;
int result = this.Attribute.Segmented
? (int) SirenixEditorFields.SegmentedProgressBarField(rect, label, this.ValueEntry.SmartValue, (long) min, (long) max,
config, valueLabel)
: (int) SirenixEditorFields.ProgressBarField(rect, label, this.ValueEntry.SmartValue, min, max, config,
valueLabel);
Rect valueRect = rect;
Vector3 valueRectPos = rect.position;
valueRectPos.x += rect.width + 10;
valueRect.position = valueRectPos;
valueRect.width = 50;
result = SirenixEditorFields.IntField(valueRect, "", result);
if (result > max) result = (int) max;
if (result < min) result = (int) min;
return result;
}
protected override double ConvertToDouble(int value)
{
return value;
}
}
Effect after adding :

版权声明
本文为[One Mr rabbit one]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210548406458.html
边栏推荐
- Resolve the error - error identifier 'attr_ id‘ is not in camel case camelcase
- ArcGIS JS version military landmark drawing (dovetail arrow, pincer arrow, assembly area) fan and other custom graphics
- 打新债中签以后怎么办,网上开户安全吗
- Research on open source OCR engine
- Come in and teach you how to solve the problem of port occupation
- The second method of file upload in form form is implemented by fileitem class, servletfileupload class and diskfileitemfactory class.
- bounding box iou
- Rt-1052 learning notes - GPIO architecture analysis
- 6-5 字符串 - 2. 字符串复制(赋值) (10 分)C语言标准函数库中包括 strcpy 函数,用于字符串复制(赋值)。作为练习,我们自己编写一个功能与之相同的函数。
- DNS cloud school | analysis of hidden tunnel attacks in the hidden corner of DNS
猜你喜欢

Shanghai a répondu que « le site officiel de la farine est illégal »: l'exploitation et l'entretien négligents ont été « noirs » et la police a déposé une plainte

Browser - learning notes

Leetcode 994, rotten orange

Elastic box model

Monte Carlo py solves the area problem! (save pupils Series)

A login and exit component based on token

How can matlab obtain the truncated image in trainingimagelabeler

2022dasctf APR x fat epidemic prevention challenge crypto easy_ real

Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference

Commit and rollback in DCL of 16 MySQL
随机推荐
三十.什么是vm和vc?
Syntax Error: TypeError: this. getOptions is not a function
How to use PM2 management application? Come in and see
PostgreSQL basic functions
【PTA】整除光棍
SQL: query duplicate data and delete duplicate data
内网渗透之DOS命令
How can matlab obtain the truncated image in trainingimagelabeler
[PTA] l1-002 printing hourglass
The ODB model calculates the data and outputs it to excel
MySQL 存储过程和函数
A useless confession artifact
Latest investigation and progress of building intelligence based on sati
Syntaxerror: unexpected token r in JSON at position 0
Es index (document name) fuzzy query method (database name fuzzy query method)
16MySQL之DCL 中 COMMIT和ROllBACK
Linux64Bit下安装MySQL5.6-不能修改root密码
Rt-1052 learning notes - GPIO architecture analysis
How to configure SSH public key in code cloud
Leetcode 542, 01 matrix