Open TheEmbracedOne opened 3 years ago
As this project hasn't merge PR for years, here is one and it is compatible to and can work together with NaughtyAttributes
I'll just paste the example:
public class MinMaxSliderExample: MonoBehaviour
{
[field: SerializeField, MinMaxSlider(-100f, 100f)]
public Vector2 OuterRange { get; private set; }
[SerializeField, MinMaxSlider(nameof(GetOuterMin), nameof(GetOuterMax), 1)] public Vector2Int _innerRange;
private float GetOuterMin() => OuterRange.x;
private float GetOuterMax() => OuterRange.y;
[field: SerializeField]
public float DynamicMin { get; private set; }
[field: SerializeField]
public float DynamicMax { get; private set; }
[SerializeField, MinMaxSlider(nameof(DynamicMin), nameof(DynamicMax))] private Vector2 _propRange;
[SerializeField, MinMaxSlider(nameof(DynamicMin), 100f)] private Vector2 _propLeftRange;
[SerializeField, MinMaxSlider(-100f, nameof(DynamicMax))] private Vector2 _propRightRange;
}
It would be really handy if one could specify min/max values from other existing variables, like with ProgressBars:
This would reduce the checks one would need to do to make sure values remain within ranges that could dynamically change. Thank you