Docsv3.31.0
Back to API Reference
Struct

UnitValue

sealed
Implements:IEquatable<UnitValue>

A numeric parameter value paired with the unit it is expressed in — the serialized form of a unit token (24, 150%, 0.5em, +10). Used as a modifier field type so the authoring default carries both number and unit in one place.

[ctor]public UnitValue(float value, UnitKind unit)
public static UnitValue Absolute(float value)
public static UnitValue Percent(float value)
public static UnitValue Em(float value)
public static UnitValue Delta(float value)
public float ResolvePx(float emSize)

Resolves to pixels against emSize (the font size): em multiplies, absolute/delta pass through.

public static float ResolvePx(float value, UnitKind unit, float emSize)

Loose value/unit overload for values read via ParameterReader.NextUnitFloat.

public bool Equals(UnitValue other)
public override bool Equals(object obj)
public override int GetHashCode()
public float value
public UnitKind unit