Scripting API
Scripting API
RangeAttribute
Class in Abyss.Core, from Abyss.Core.
Shows a number field as a slider between two values, and keeps what is typed into it between them.
public sealed class RangeAttribute : AttributeRemarks
It bounds the inspector, not the field. A system can still write any value, and the inspector shows what is there; only what somebody drags or types is held inside the range.
For a number only. On anything else the generator says so and the attribute does nothing. On a whole-number field the slider moves between the whole numbers inside the range.
[AbyssComponent]public partial struct Spin{ [Range(0f, 10f)] public float Speed;}Constructors
RangeAttribute
public RangeAttribute(double min, double max)Shows a number field as a slider between two values, and keeps what is typed into it between them.
Parameters
min: The smallest value the slider reaches.max: The largest value the slider reaches.
It bounds the inspector, not the field. A system can still write any value, and the inspector shows what is there; only what somebody drags or types is held inside the range.
For a number only. On anything else the generator says so and the attribute does nothing. On a whole-number field the slider moves between the whole numbers inside the range.
[AbyssComponent]public partial struct Spin{ [Range(0f, 10f)] public float Speed;}Properties
Min
public double Min { get; }The smallest value the slider reaches.
Max
public double Max { get; }The largest value the slider reaches.
