RaptorStepRule
Step size and range for a draggable Properties number field.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | struct | preview, since 0.1.0 |
Create one with Every. The default value is not a valid rule.
public readonly struct RaptorStepRuleFields
Integer
public readonly bool Integer;Whether values are whole numbers.
Max
public readonly float Max;The highest value a drag reaches.
Min
public readonly float Min;The lowest value a drag reaches.
Step
public readonly float Step;The step size. Dragging snaps to multiples of it.
Properties
IsValid
public bool IsValid { get; }Whether the rule is usable. False for the default value, which has no step. Properties fields reject invalid rules.
Methods
Every
public static RaptorStepRule Every(float step, float min = float.NegativeInfinity, float max = float.PositiveInfinity, bool integer = false)Creates a rule with even steps of step between min and max.
| Parameter | Type | Default | Description |
|---|---|---|---|
step | float | The step size; must be positive. | |
min | float | float.NegativeInfinity | The lowest value. |
max | float | float.PositiveInfinity | The highest value. |
integer | bool | false | Whether values are whole numbers. |
Returns: The rule.