当前位置:网站首页>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
边栏推荐
- Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
- DNS cloud school | quickly locate DNS resolution exceptions and keep these four DNS status codes in mind
- Commit and rollback in DCL of 16 MySQL
- Easy to use nprogress progress bar
- GO语言开发天天生鲜项目第三天 案例-新闻发布系统二
- Recognition of high-speed road signs by Matlab using alexnet
- Flex layout
- [latex] 5 how to quickly write out the latex formula corresponding to the formula
- Automatically fill in body temperature and win10 task plan
- 三十.什么是vm和vc?
猜你喜欢
Imitation Baidu map realizes the three buttons to switch the map mode by automatically shrinking the bottom
Numpy mathematical function & logical function
LeetCode 542、01 矩阵
Leetcode 542, 01 matrix
2022DASCTF Apr X FATE 防疫挑战赛 CRYPTO easy_real
Customize timeline component styles
Leetcode 994, rotten orange
Shanghai responded that "flour official website is an illegal website": neglect of operation and maintenance has been "hacked", and the police have filed a case
Commit and ROLLBACK in DCL of 16mysql
Preliminary understanding of cache elimination algorithm (LRU and LFU)
随机推荐
How to protect ECs from hacker attacks?
Servlet learning notes
Leetcode 1337. Row K with the weakest combat effectiveness in the matrix
SQL Server Connectors By Thread Pool | DTSQLServerTP 插件使用说明
GO语言开发天天生鲜项目第三天 案例-新闻发布系统二
BMP JPEG 图片转换为矢量图像 ContourTrace
Customize timeline component styles
Numpy mathematical function & logical function
Flex layout
The market share of the financial industry exceeds 50%, and zdns has built a solid foundation for the financial technology network
Thirty What are VM and VC?
star
GO語言開發天天生鮮項目第三天 案例-新聞發布系統二
Browser - learning notes
Latest investigation and progress of building intelligence based on sati
Elastic box model
UnhandledPromiseRejectionwarning:CastError: Cast to ObjectId failed for value
Commit and ROLLBACK in DCL of 16mysql
Monte Carlo py solves the area problem! (save pupils Series)
Numpy - creation of data type and array