Skip to content

Game.TutorialFireActivation

Assembly:
{{ Likely part of the main Game assembly for Cities: Skylines 2 modding (exact assembly name not present in source). }}

Namespace: Game.Prefabs

Type:
public class

Base:
TutorialActivation

Summary:
TutorialFireActivation is a prefab component used by the tutorial/prefab conversion pipeline to mark prefabs that should activate fire-related tutorial behavior. It exposes a flag enum (FireActivationTarget) that determines what kind of fire activation data components will be added to the prefab's entity when the prefab is converted to ECS. The default value enables both Building and Forest targets.


Fields

  • public enum FireActivationTarget
    Defines bitmask targets for which fire activation data should be added to the prefab. Values:
  • Building = 1
  • Forest = 2

  • public FireActivationTarget m_Target = (FireActivationTarget)3
    Annotated with [EnumFlag], this public field controls which activation target(s) are active for this prefab. Default (3) means both Building and Forest are selected (1 | 2). Because EnumFlag is used, multiple targets can be selected via the inspector.

Properties

  • None

Constructors

  • public TutorialFireActivation()
    {{ Implicit default constructor. The field initializer sets m_Target to 3 (both Building and Forest) by default. No custom construction logic is present in the source. }}

Methods

  • public override void GetArchetypeComponents(HashSet<ComponentType> components)
    {{ This override is intentionally empty in the provided source. It does not add any archetype components. If you need archetype-time components for this activation, implement them here. }}

  • public override void GetPrefabComponents(HashSet<ComponentType> components)
    {{ Adds required component types to the prefab conversion result depending on m_Target:

  • Calls base.GetPrefabComponents(components) first to include any components the base class adds.
  • If the Building flag is set in m_Target, adds ComponentType.ReadWrite().
  • If the Forest flag is set in m_Target, adds ComponentType.ReadWrite(). This method is used during prefab -> entity conversion so that resulting entities contain the correct data components for the tutorial fire activation logic. }}

Usage Example

// Attach TutorialFireActivation to a prefab in the editor.
// The [EnumFlag] attribute lets you choose Building, Forest, or both in the inspector.
// At prefab conversion time the system will call GetPrefabComponents and add the corresponding components:

// Example pseudo-flow during conversion:
var prefabComponent = prefab.GetComponent<TutorialFireActivation>();
var componentSet = new HashSet<ComponentType>();
prefabComponent.GetPrefabComponents(componentSet);
// if Building flag set -> componentSet contains ComponentType.ReadWrite<BuildingFireActivationData>()
// if Forest flag set   -> componentSet contains ComponentType.ReadWrite<ForestFireActivationData>()

// In code you can check or set the target:
prefabComponent.m_Target = TutorialFireActivation.FireActivationTarget.Building;

// No runtime OnCreate/Start logic is defined in this component; it only affects prefab-to-entity conversion.

{{ Additional notes: - BuildingFireActivationData and ForestFireActivationData must be existing ECS component data types used by the game's tutorial/fire systems. - Because GetArchetypeComponents is empty, no archetype-only components are required by this activation. If you need archetype-level guarantees (for queries that run before prefab conversion completion), implement them in GetArchetypeComponents. - The ComponentMenu attribute places this component under "Tutorials/Activation/" in the Unity component menu and associates it with TutorialPrefab for authoring convenience. }}