当前位置:网站首页>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
边栏推荐
- Why does ES6 need to introduce map when JS already has object type
- A useless confession artifact
- Common form verification
- Identification of bolt points in aerial photography based on perception
- Click an EL checkbox to select all questions
- 上海回應“面粉官網是非法網站”:疏於運維被“黑”,警方已立案
- Leetcode 74. Search two-dimensional matrix
- Numpy sort search count set
- Scrapy教程 - (2)寫一個簡單爬蟲
- Alicloud: could not connect to SMTP host: SMTP 163.com, port: 25
猜你喜欢
Operation of numpy array
LeetCode 994、腐烂的橘子
【栈和队列专题】—— 滑动窗口
LeetCode 542、01 矩阵
Commit and ROLLBACK in DCL of 16mysql
RT-1052学习笔记 - GPIO架构分析
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
Go zero framework database avoidance Guide
Development of Matlab GUI bridge auxiliary Designer (functional introduction)
Monte Carlo py solves the area problem! (save pupils Series)
随机推荐
高薪程序员&面试题精讲系列91之Limit 20000加载很慢怎么解决?如何定位慢SQL?
JDBC tool class jdbcfiledateutil uploads files and date format conversion, including the latest, simplest and easiest way to upload single files and multiple files
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
The market share of the financial industry exceeds 50%, and zdns has built a solid foundation for the financial technology network
Install MySQL 5.0 under Linux 64bit 6 - the root password cannot be modified
Leetcode 1337. Row K with the weakest combat effectiveness in the matrix
The ODB model calculates the data and outputs it to excel
ArcGIS JS version military landmark drawing (dovetail arrow, pincer arrow, assembly area) fan and other custom graphics
LeetCode 709、转换成小写字母
Latest investigation and progress of building intelligence based on sati
SQL gets the latest record of the data table
JSX syntax rules
Vscode download speed up
Syntax Error: TypeError: this. getOptions is not a function
Leetcode 1346. Check whether integers and their multiples exist
DNS cloud school rising posture! Three advanced uses of authoritative DNS
Go zero framework database avoidance Guide
How to configure SSH public key in code cloud
Syntaxerror: unexpected token r in JSON at position 0
[graph theory brush question-4] force deduction 778 Swimming in a rising pool