Types and operations
Choose a type
MaskedValue<T>, MaskedString, and MaskedData<T> do not provide integrity detection. Use GuardedValue<T> for unmanaged values whose corruption should trigger a response.
Read, write, and calculate
Numeric wrappers also support %, %=, unary signs, and ++/--. Results retain the wrapper type: var result = health + 10 is a GuardedValue<int>. Use int result = health + 10 or health.Value + 10 for a plain number.
Integer addition, subtraction, and multiplication wrap on overflow, including inside a caller's checked block. Use .Value when you need the underlying type's own arithmetic rules or custom struct operations.
GuardedValue<T>.RefreshMask() changes the masked representation while keeping the value. Call it explicitly when needed; reads already validate integrity.
See the Inspector guide for field setup and tampering guide for failure handling.