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
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