Skip to content

Game.Prefabs.UIEditorTutorialGroupPrefab

Assembly:
Assembly-CSharp (typical runtime assembly for game scripts; actual assembly may vary)

Namespace:
Game.Prefabs

Type:
public class

Base:
UITutorialGroupPrefab

Summary:
A prefab class used by the UI tutorial system in the editor. This prefab class ensures that the entity/prefab includes a read/write UIEditorTutorialGroupData ECS component during prefab-to-entity conversion or when collecting required component types. It is annotated with a ComponentMenu attribute so it is exposed under the "UI/" menu in the Unity editor.


Fields

  • None
    This class does not declare any instance or static fields.

Properties

  • None
    This class does not declare any properties.

Constructors

  • public UIEditorTutorialGroupPrefab()
    Default public constructor (implicit if not defined). Typical usage is the prefab instance created/managed by the Unity editor or prefab system rather than instantiated directly in code.

Methods

  • public override void GetPrefabComponents(HashSet<ComponentType> components)
    Overrides the base prefab behavior to add the UIEditorTutorialGroupData component type. Implementation details:
  • Calls base.GetPrefabComponents(components) to include any component types defined by the base UITutorialGroupPrefab.
  • Adds ComponentType.ReadWrite() to the provided HashSet to declare that instances of this prefab require the UIEditorTutorialGroupData component with read/write access.

Behavioral notes: - This method is used when gathering which ECS component types a prefab requires so that the conversion/creation pipeline can correctly create entities with the necessary components. - UIEditorTutorialGroupData refers to the data component used by the editor-specific tutorial group implementation; ensure that the component type exists in your mod or game codebase.

Usage Example

// Example: collect prefab component types into a set
var prefab = /* obtain UIEditorTutorialGroupPrefab from project assets or factory */;
var components = new HashSet<Unity.Entities.ComponentType>();
prefab.GetPrefabComponents(components);

// After the call, components will include types added by the base class
// and ComponentType.ReadWrite<UIEditorTutorialGroupData>().
if (components.Contains(ComponentType.ReadWrite<UIEditorTutorialGroupData>()))
{
    // The prefab will create entities that include UIEditorTutorialGroupData
}

Additional notes: - The class is decorated with [ComponentMenu("UI/", new Type[] { })], which places it under the "UI/" menu in Unity's component menu for easier authoring. - This class is intended to be used by the editor/tutorial UI systems; when creating custom prefabs or extending tutorial functionality, ensure compatibility with the expected UIEditorTutorialGroupData layout and semantics.