CompositeResourceProvider
interludesoftware.tick¶
Interlude.Tick¶
CompositeResourceProvider Class¶
Resource provider that walks an ordered list of inner providers on every TryGetFont(string, int, Font) / TryGetImage(string, Texture) / TryGetShader(string, Shader) lookup, returning the first hit. Index 0 has the highest priority; later entries act as progressively lower-priority fallbacks. Null entries in the list are silently skipped.
Typical wiring: BaseGameUI builds a composite by adding the
user-supplied providers (in inspector order) followed by the bundled
DefaultTickConfig. Game code with a reference to the composite can
Push(IGUIResourceProvider) additional providers at runtime (e.g. activating a
localisation pack) and Remove(IGUIResourceProvider) them later.
Inheritance System.Object → CompositeResourceProvider
Implements IGUIResourceProvider
Properties¶
CompositeResourceProvider.Count Property¶
The number of registered providers.
Property Value¶
CompositeResourceProvider.Providers Property¶
Read-only view of the providers in priority order (index 0 highest).
public System.Collections.Generic.IReadOnlyList<Interlude.Tick.IGUIResourceProvider> Providers { get; }
Property Value¶
System.Collections.Generic.IReadOnlyList<IGUIResourceProvider>
Methods¶
CompositeResourceProvider.Add(IGUIResourceProvider) Method¶
Appends provider at the end of the list (lowest priority). Null is a silent no-op so callers can `Add` the result of a dictionary lookup without guarding it themselves.
Parameters¶
provider IGUIResourceProvider
CompositeResourceProvider.Clear() Method¶
Removes all providers.
CompositeResourceProvider.Push(IGUIResourceProvider) Method¶
Inserts provider at index 0 (highest priority). Use this when game code wants a temporary override (theme swap, localisation pack) to shadow whatever was previously at the top.
Parameters¶
provider IGUIResourceProvider
CompositeResourceProvider.Remove(IGUIResourceProvider) Method¶
Removes the first occurrence of provider. Returns true if removed.
Parameters¶
provider IGUIResourceProvider
Returns¶
CompositeResourceProvider.TryGetFont(string, int, Font) Method¶
Walks providers in priority order and returns the first exact font match for fontName at size.
Parameters¶
fontName System.String
size System.Int32
foundFont Font
Implements TryGetFont(string, int, Font)
Returns¶
CompositeResourceProvider.TryGetFontScaled(string, int, Font) Method¶
Walks providers in priority order and returns the best available font for fontName at requestedSize.
public bool TryGetFontScaled(string fontName, int requestedSize, out Interlude.Tick.Font foundFont);
Parameters¶
fontName System.String
requestedSize System.Int32
foundFont Font
Implements TryGetFontScaled(string, int, Font)
Returns¶
CompositeResourceProvider.TryGetImage(string, Texture) Method¶
Walks providers in priority order and returns the first image matching imageName.
Parameters¶
imageName System.String
foundImage UnityEngine.Texture
Implements TryGetImage(string, Texture)
Returns¶
CompositeResourceProvider.TryGetShader(string, Shader) Method¶
Walks providers in priority order and returns the first shader matching shaderName.
Parameters¶
shaderName System.String
foundShader UnityEngine.Shader
Implements TryGetShader(string, Shader)
Returns¶
CompositeResourceProvider.TryGetSprite(string, Sprite) Method¶
Walks providers in priority order and returns the first sprite matching spriteName.
Parameters¶
spriteName System.String
foundSprite UnityEngine.Sprite
Implements TryGetSprite(string, Sprite)