Game.Tutorials.TutorialAlternative
Assembly:
Assembly-CSharp (game managed assembly; exact assembly name may vary depending on build/mod)
Namespace:
Game.Tutorials
Type:
struct
Base:
Unity.Entities.IBufferElementData
Summary:
Represents a single alternative entry for the tutorial system as a buffer element. Intended to be stored in a DynamicBuffer
Fields
public Unity.Entities.Entity m_Alternative
Holds the Entity reference for the alternative tutorial option. The value is typically another tutorial-related entity (for example, an entity containing a different tutorial step or UI). When used in a DynamicBuffer, each element's m_Alternative points to one alternative.
Properties
- None.
This struct exposes no properties; it only contains the public field above.
Constructors
- Implicit default struct constructor (
public TutorialAlternative()
)
As a value type, the default parameterless constructor is provided by C#. Initialize instances by assignment or when adding to a DynamicBuffer (e.g.,new TutorialAlternative { m_Alternative = someEntity }
).
Methods
- None.
There are no methods defined on this type.
Usage Example
// Example: adding alternatives to an entity's buffer
using Unity.Entities;
using Game.Tutorials;
// Acquire EntityManager (example assumes ECS world already initialized)
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
// Create or obtain the entity that will carry tutorial alternatives
Entity tutorialContainer = entityManager.CreateEntity();
// Add a DynamicBuffer<TutorialAlternative> to the container
entityManager.AddBuffer<TutorialAlternative>(tutorialContainer);
// Obtain the buffer and add alternatives
var buffer = entityManager.GetBuffer<TutorialAlternative>(tutorialContainer);
// Assume alternativeEntity1 and alternativeEntity2 are existing tutorial-related entities
Entity alternativeEntity1 = /* obtain or create entity */;
Entity alternativeEntity2 = /* obtain or create entity */;
buffer.Add(new TutorialAlternative { m_Alternative = alternativeEntity1 });
buffer.Add(new TutorialAlternative { m_Alternative = alternativeEntity2 });