Table of Contents

Class TemplatesProvider

Namespace
Fallencake.UI
Assembly
Fallencake.UI.dll

ScriptableObject registry that stores references to available IDataTemplate assets.

[CreateAssetMenu(fileName = "TemplatesProvider", menuName = "Modular UI/Templates/Templates Provider", order = 0)]
public class TemplatesProvider : ScriptableObject, ITemplatesProvider
Inheritance
object
Object
ScriptableObject
TemplatesProvider
Implements

Properties

Templates

Underlying list of template assets.

public List<ScriptableObject> Templates { get; }

Property Value

List<ScriptableObject>

Methods

GetTemplate(string)

Finds a template by its TemplateName.

public IDataTemplate GetTemplate(string templateName)

Parameters

templateName string

Logical template name to match.

Returns

IDataTemplate

The matching template or null if not found.

GetTemplateByIndex(int)

Gets a template by list index when present and of expected type.

public IDataTemplate GetTemplateByIndex(int index)

Parameters

index int

Index into Templates.

Returns

IDataTemplate

The template at index or null if invalid or of different type.