Skip to content

Game.Prefabs.TutorialActivationEventData

Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs

Type: struct

Base: Unity.Entities.IBufferElementData

Summary:
Represents a buffer element used to signal or queue a tutorial activation. This struct is an IBufferElementData so it can be stored in a DynamicBuffer on an entity. The single field is an Entity reference to the tutorial (typically a prefab or tutorial entity) that should be activated or processed by a system.


Fields

  • public Unity.Entities.Entity m_Tutorial
    An Entity handle pointing to the tutorial to activate. This is typically a prefab or an entity representing the tutorial content/definition. Consumers should treat this as an Entity reference and resolve/instantiate it according to their runtime logic.

Properties

  • None. This type exposes its data via the public field and implements IBufferElementData for DynamicBuffer usage.

Constructors

  • Default value-type constructor (implicit)
    Since this is a simple struct, it uses the default parameterless constructor provided by C#. You can initialize it with an object initializer, e.g. new TutorialActivationEventData { m_Tutorial = someEntity }.

Methods

  • None. This struct contains only data and no behavior.

Usage Example

// Example: enqueue a tutorial activation onto an entity's DynamicBuffer
public partial class EnqueueTutorialSystem : SystemBase
{
    protected override void OnUpdate()
    {
        Entity tutorialPrefab = /* obtain reference to tutorial prefab entity */;

        Entities
            .WithName("EnqueueTutorial")
            .WithoutBurst()
            .ForEach((ref DynamicBuffer<Game.Prefabs.TutorialActivationEventData> buffer) =>
            {
                buffer.Add(new Game.Prefabs.TutorialActivationEventData
                {
                    m_Tutorial = tutorialPrefab
                });
            }).Run();
    }
}

Notes and tips: - Because this is an IBufferElementData, read and write it through DynamicBuffer. - The Entity stored in m_Tutorial may be a prefab; systems consuming the buffer should handle instantiation or activation appropriately. - Keep access to DynamicBuffer operations on the main thread or properly schedule jobs that use DynamicBuffer APIs and consider safety rules for concurrency.