Game.UI.Widgets.AllowMinGreaterMaxAttribute
Assembly:
Assembly-CSharp (game)
Namespace:
Game.UI.Widgets
Type:
class
Base:
UnityEngine.PropertyAttribute
Summary:
A lightweight Unity attribute used to mark a field or property so that UI or custom property drawers allow a "min" value that is greater than a "max" value. This attribute itself contains no logic — it only serves as a marker. Typical usage is alongside custom inspectors or property drawers that check for this attribute and adjust validation, clamping, or displayed controls accordingly.
- Targets: Property and Field (see AttributeUsage in source).
- Intended for use with the game's UI widget system or any PropertyDrawer that needs to permit inverted ranges.
Fields
None
This attribute defines no instance or static fields.
Properties
None
There are no exposed properties on this attribute.
Constructors
public AllowMinGreaterMaxAttribute()
Default parameterless constructor. The attribute carries no data; simply applying it to a field or property is sufficient for consumers (e.g., custom drawers) to detect the intent.
Methods
None
This attribute provides no methods.
Usage Example
using Game.UI.Widgets;
using UnityEngine;
public class RangeExample : MonoBehaviour
{
// A custom property drawer in the game code can detect this attribute
// and allow min to be greater than max when rendering the UI.
[AllowMinGreaterMax]
public Vector2 myRange; // x = min, y = max
}
Notes: - Because this attribute inherits from UnityEngine.PropertyAttribute, Unity's inspector and any custom PropertyDrawer can detect it via reflection. - Applying this attribute has no built-in effect unless the UI code or property drawer explicitly checks for it and implements the desired behavior (for example, skipping clamping or showing an inverted slider).