Docsv2.12.12
Back to API Reference
Struct

ParameterReader

sealed

Zero-allocation tokenizer for comma-separated modifier parameters. Eliminates manual IndexOf/Slice/Trim boilerplate in modifier parsers.

Example

csharp

Nested Types

public bool IsEmpty{ get }

True if there are no more tokens to read.

[ctor]public ParameterReader()
[ctor]public ParameterReader()
public static bool ParseFloat()

Parses a span as float using InvariantCulture. For pre-extracted tokens where Next() was already called.

public bool NextFloat()

Reads the next token as a float. Returns false if missing or unparseable; on failure value is left at defaultValue.

public bool NextInt()

Reads the next token as an int. Returns false if missing or unparseable; on failure value is left at defaultValue.

public bool NextColor()

Reads the next token as a Color32 via ColorParsing. Returns false if missing or unparseable; on failure value is left at defaultValue.

public bool NextEnum()

Reads the next token as a value of enum T. Matches the full enum-member name case-insensitively; for single-character tokens, also matches against the first letter of any member whose initial is unique within the enum (e.g. r → Radial when no other member starts with R). Members whose initial collides with another member's keep working under their full name but lose the short alias. Returns false if missing or unmatched; on failure value is left at defaultValue.

public bool NextUnitFloat()

Reads the next token as a float with optional unit suffix. Recognizes: 24 (absolute), 150%, 0.5em, +10/-5 (delta). Always uses InvariantCulture.

public bool NextString()

Reads the next token as a string (allocates). Returns false if missing or empty.