Game.Tutorials.TutorialLinkData
Assembly:
Assembly-CSharp (common Unity game assembly for in-game scripts)
Namespace:
Game.Tutorials
Type:
public struct
Base:
System.ValueType (struct) — implements Unity.Entities.IBufferElementData
Summary:
A simple buffer element used to link an Entity that represents a tutorial. Instances of this struct are intended to be stored in a DynamicBuffer
Fields
public Unity.Entities.Entity m_Tutorial
Holds the Entity reference to the tutorial (e.g., a tutorial step or tutorial data entity). When stored in a DynamicBuffer, each element represents one linked tutorial Entity.
Properties
- This struct defines no properties. It exposes a single public field for the referenced Entity.
Constructors
public TutorialLinkData()
No explicit constructors are defined in the source; the struct uses the default value-initialized constructor. Create instances using initializer syntax, e.g.new TutorialLinkData { m_Tutorial = someEntity }
.
Methods
- This struct defines no methods.
Usage Example
// Example: adding a buffer and linking tutorial entities to it
// Assume `entityManager` is available and `someTutorialEntity` / `otherTutorialEntity` are valid Entity values
Entity container = entityManager.CreateEntity();
// Add the buffer to the container entity
var buffer = entityManager.AddBuffer<Game.Tutorials.TutorialLinkData>(container);
// Add tutorial links
buffer.Add(new Game.Tutorials.TutorialLinkData { m_Tutorial = someTutorialEntity });
buffer.Add(new Game.Tutorials.TutorialLinkData { m_Tutorial = otherTutorialEntity });
// Example inside a system (accessing the DynamicBuffer)
public partial struct TutorialSystem : ISystem
{
public void OnUpdate(ref SystemState state)
{
foreach (var (buffer, entity) in SystemAPI.Query<DynamicBuffer<Game.Tutorials.TutorialLinkData>>().WithEntityAccess())
{
// Iterate linked tutorial entities
for (int i = 0; i < buffer.Length; i++)
{
Entity tutorialEntity = buffer[i].m_Tutorial;
// process tutorialEntity...
}
}
}
}