Class CachedText

Namespace
TDMaker.Unity.Hud
Assembly
TDMaker.Unity.dll

Caches the formatted text of a key with one integer (for example "Sell +{0}"), keeping the text of every number seen until the texts (Version: language, tables) change, so frequently updated labels do not allocate.

public sealed class CachedText
Inheritance
CachedText
Inherited Members

Constructors

CachedText(string)

Creates a cache for the text of textKey (with a {0} placeholder).

public CachedText(string textKey)

Parameters

textKey string

Methods

Get(TextResolver, int)

Returns the text for number from texts.

public string Get(TextResolver texts, int number)

Parameters

texts TextResolver
number int

Returns

string