Learn more about HUD content providers.
Content providers are used to define the content that’s displayed by HUD elements.
The root HUD itself is a content provider and will get it’s content (also refered to as user) from the HUD it’s used to display (see this documentation on HUDs).
The actual use of content providers depends on the used UI module.
Unity UI #
The Unity UI module uses components to add content providers.
Content components have a Content Provider field available to define which content provider they get their displayed content from.
The following content providers are available (other Makinom extensions can add their own content providers, e.g. ORK Framework).
The HUD component is the root of all HUDs and is a content provider.
It’ll get it’s content from the HUD that’s displaying it.
HUD Content Provider #
The HUD Content Provider component is an empty content provider.
It’s mainly used on UI prefabs that are created by other HUD content components, e.g. listing things by spawning prefabs for each listed content. The content of the HUD Content Provider component that’s found on a spawned prefab will be set to the used content.
HUD Content Provider (GameObject) #
The HUD Content Provider (GameObject) component uses a defined game object as it’s content.
The game object is defined by a game object selection, e.g. allowing to use the Player or something stored in Selected Data as content.