Docsv3.20.2
Back to API Reference
Interface

IUniTextResolver

abstract

Hook that overrides the source text of a UniTextBase before it is parsed, without writing the serialized text, so the override never marks a scene or prefab dirty.

Remarks

Assigned through TextResolver. TryResolve runs on the main thread when the source text changes or is marked dirty, not on every rebuild. A resolver whose output changes while the source stays the same, such as on a language switch, calls SetDirty(UniTextDirty.Text) on the owner it receives in OnAttached.
public virtual void OnAttached()

Receives the component the resolver is assigned to, before the first TryResolve for it.

public virtual void OnDetached()

Releases the component when the resolver is replaced or cleared, or the component is destroyed.

public abstract bool TryResolve(ReadOnlyMemory<char> source, ReadOnlyMemory<char> result)

Produces the text to parse in place of source.