A lot of projects use encapsulation and the current ProgressBar can be considered a "Fixed" progress bar as you define the max within the attribute. So, if we wanted something more dynamic the progress bar should be enhanced to find a serializedProperty within the object/struct so you can manipulate the progress bar's max value on EditorTime/RunTime.
For a progress bar, let's say we have a health struct/class
[System.Serializable]
public struct Health {
public float current, max;
}
public class Unit : MonoBehaviour {
public Health configs;
}
When sticking [ProgressBar] on current, we can't referenced the max field automatically, so the default value of the progress bar is current/100f. When parsing a property.propertyPath the Editor will output configs.current as the entire path.
We can recursively/iteratively build and generate a path of serializedProperty/serializedObject to grab the correct serializedProperty so that the ProgressBar can be dynamic instead.
[ProgressBar(maxProperty = "max")]
A lot of projects use encapsulation and the current ProgressBar can be considered a "Fixed" progress bar as you define the
maxwithin the attribute. So, if we wanted something more dynamic the progress bar should be enhanced to find a serializedProperty within the object/struct so you can manipulate the progress bar's max value on EditorTime/RunTime.For a progress bar, let's say we have a health struct/class
When sticking
[ProgressBar]on current, we can't referenced themaxfield automatically, so the default value of the progress bar iscurrent/100f. When parsing aproperty.propertyPaththe Editor will outputconfigs.currentas the entire path.We can recursively/iteratively build and generate a path of serializedProperty/serializedObject to grab the correct serializedProperty so that the ProgressBar can be dynamic instead.