Skip to content

Game.Prefabs.UIInfoviewsConfigurationPrefab

Assembly: Game
Namespace: Game.Prefabs

Type: class

Base: PrefabBase

Summary:
Prefab type used to configure UI "infoviews" settings for the game. This prefab exposes a reference to an InfomodePrefab used for the "homeless" infomode and registers required dependencies and ECS component types so the corresponding runtime data (UIInfoviewsConfigurationData) is available to the entity system. Typically used by the game's prefab system and editor to assemble UI configuration data into the running world.


Fields

  • public InfomodePrefab m_HomelessInfomodePrefab
    Reference to the InfomodePrefab used for the homeless infomode. This should be set in the prefab asset in the editor to point to the appropriate infomode prefab. The prefab is added to the dependency list so it will be included/loaded together with this configuration.

Properties

  • (none)
    This class does not declare any properties. It relies on inherited behavior from PrefabBase and exposes public fields for editor assignment.

Constructors

  • public UIInfoviewsConfigurationPrefab()
    No explicit constructor is defined in the source; the class uses the default parameterless constructor inherited from System.Object. Initialization of fields should be done via the editor or by overriding lifecycle methods on derived types if needed.

Methods

  • public override void GetDependencies(List<PrefabBase> prefabs)
    Adds this prefab's dependencies to the provided list. Implementation:
  • Calls base.GetDependencies(prefabs).
  • Adds m_HomelessInfomodePrefab to the list.
    Purpose: ensure referenced prefabs are known to the prefab loader so they are included in builds/loads.

  • public override void GetPrefabComponents(HashSet<ComponentType> components)
    Registers ECS component types required by this prefab. Implementation:

  • Calls base.GetPrefabComponents(components).
  • Adds ComponentType.ReadWrite() to the set.
    Purpose: ensures that the UIInfoviewsConfigurationData component is created/available on relevant entities when this prefab is instantiated.

Usage Example

// Example of how this prefab contributes dependencies and components.
// The prefab asset should have m_HomelessInfomodePrefab assigned in the editor.

public class MyPrefabSetup
{
    public void Collect(Game.Prefabs.UIInfoviewsConfigurationPrefab prefab)
    {
        var deps = new List<PrefabBase>();
        prefab.GetDependencies(deps);
        // deps now contains prefab.m_HomelessInfomodePrefab (if assigned)

        var comps = new HashSet<ComponentType>();
        prefab.GetPrefabComponents(comps);
        // comps now contains ComponentType.ReadWrite<UIInfoviewsConfigurationData>()
    }
}

Notes and guidance for modders: - Make sure to assign m_HomelessInfomodePrefab in the prefab asset; otherwise, the dependency list will include a null reference. Consider adding null checks if you extend this class. - The class adds the UIInfoviewsConfigurationData component type to the prefab components set — ensure any systems that rely on that component are present in your mod or game runtime. - The class is decorated with [ComponentMenu("Settings/", new Type[] { })], meaning it is exposed in the editor's component/prefab menus under "Settings/". Use that to find and configure instances in the editor.