ProgressBar Attribute
Attribute to draw a progress bar
- Parameters:
floatmaxValue: The maximum value of the progress barfloatbarHeight: The height of the progress bar in pixels
Moving the value slider will update the progress bar value:
using UnityEngine;
using EditorAttributes;
public class AttributesExample : MonoBehaviour
{
[SerializeField, Range(0f, 100f)] private float value;
[SerializeField, ProgressBar] private int intBar;
[SerializeField, ProgressBar(100f, 50f)] private float floatBar;
void OnValidate()
{
intBar = (int)value;
floatBar = value;
}
}
Note
The ProgressBar Attribute cannot be attached to vector fields