Skip to content

Game.InfomodeBasePrefab

Assembly:
Namespace: Game.Prefabs

Type: abstract class

Base: InfomodePrefab

Summary:
Abstract base prefab for infomode-related prefabs that can be included in one or more Infomode groups. This class extends InfomodePrefab and augments dependency collection by adding any referenced InfomodeGroupPrefab instances (m_IncludeInGroups) into the prefab dependency list so they are loaded/available when this prefab is used.


Fields

  • public InfomodeGroupPrefab[] m_IncludeInGroups
    Array of InfomodeGroupPrefab references. When GetDependencies is called, each non-null element in this array is added to the provided dependency list. May be null if no groups are specified.

Properties

  • None

Constructors

  • public InfomodeBasePrefab()
    No explicit constructor is defined in source; the default parameterless constructor is provided by the compiler. The class is abstract, so it is intended to be subclassed and not instantiated directly.

Methods

  • public override void GetDependencies(List<PrefabBase> prefabs)
    Overrides the base implementation to collect additional prefab dependencies. Behavior:
  • Calls base.GetDependencies(prefabs) first to include dependencies from the base class.
  • If m_IncludeInGroups is not null, iterates the array and adds each element to the supplied prefabs list (via prefabs.Add(m_IncludeInGroups[i])).
  • Ensures referenced InfomodeGroupPrefab instances are known to the loader and treated as dependencies.

Usage Example

// Example subclass that specifies groups to include
public class MyInfomodePrefab : InfomodeBasePrefab
{
    public MyInfomodePrefab()
    {
        // assign one or more group prefabs via inspector or code
        m_IncludeInGroups = new InfomodeGroupPrefab[] { myGroupPrefabA, myGroupPrefabB };
    }

    public override void GetDependencies(List<PrefabBase> prefabs)
    {
        // base implementation in InfomodeBasePrefab will add m_IncludeInGroups entries
        base.GetDependencies(prefabs);

        // add any additional dependencies specific to this prefab
        // prefabs.Add(myOtherPrefab);
    }
}