Get RAPTOR

RaptorStepRule

Step size and range for a draggable Properties number field.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorstructpreview, since 0.1.0

Create one with Every. The default value is not a valid rule.

public readonly struct RaptorStepRule

Fields

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.

ParameterTypeDefaultDescription
stepfloatThe step size; must be positive.
minfloatfloat.NegativeInfinityThe lowest value.
maxfloatfloat.PositiveInfinityThe highest value.
integerboolfalseWhether values are whole numbers.

Returns: The rule.