当前位置:网站首页>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
边栏推荐
- What is the difference between a host and a server?
- After route link navigation, the sub page does not display the navigation style problem
- JDBC database addition, deletion, query and modification tool class
- SQL Server Connectors By Thread Pool | DTSQLServerTP plugin instructions
- Plato Farm元宇宙IEO上线四大,链上交易颇高
- Identification of bolt points in aerial photography based on perception
- Historical track data reading of Holux m1200-e Bluetooth GPS track recorder
- 【PTA】L1-002 打印沙漏
- The market share of the financial industry exceeds 50%, and zdns has built a solid foundation for the financial technology network
- [graph theory brush question-4] force deduction 778 Swimming in a rising pool
猜你喜欢
Latest investigation and progress of building intelligence based on sati
Recognition of high-speed road signs by Matlab using alexnet
GO语言开发天天生鲜项目第三天 案例-新闻发布系统二
Case of the third day of go language development fresh every day project - news release system II
Plato Farm元宇宙IEO上线四大,链上交易颇高
【PTA】整除光棍
How can matlab obtain the truncated image in trainingimagelabeler
Solution: NPM err! code ELIFECYCLE npm ERR! errno 1
Commande dos pour la pénétration de l'Intranet
Devexpress 14.1 installation record
随机推荐
Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart
Why does ES6 need to introduce map when JS already has object type
【PTA】L1-006 连续因子
Latest investigation and progress of building intelligence based on sati
XXXI` Prototype ` displays prototype properties and`__ proto__` Implicit prototype properties
The second method of file upload in form form is implemented by fileitem class, servletfileupload class and diskfileitemfactory class.
Livego + ffmpeg + RTMP + flvjs to realize live video
Research on open source OCR engine
A useless confession artifact
Flex layout
The construction and use of Fortress machine and springboard machine jumpserver are detailed in pictures and texts
Vscode download speed up
Customize timeline component styles
LeetCode 20、有效的括号
黑客的入侵方式你知道几种?
【PTA】整除光棍
堡垒机、跳板机JumpServer的搭建,以及使用,图文详细
Preliminary understanding of cache elimination algorithm (LRU and LFU)
三十.什么是vm和vc?
I JS deep copy and shallow copy