Game.Tutorials.TutorialData
Assembly:
Likely Assembly-CSharp (common for Unity projects); not explicitly specified in the source file.
Namespace:
Game.Tutorials
Type:
struct
Base:
Implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
A simple component-data struct used by the tutorial systems to carry a priority value. Because it implements IComponentData it can be attached to entities and used in ECS queries. Implementing IQueryTypeParameter indicates it is intended to be usable as a query parameter in the DOTS query APIs.
Fields
public int m_Priority
Stores the priority of the tutorial (or tutorial-related action) as an integer. Typically used by systems to determine processing order or importance. Default value when not set is 0. The "m_" prefix follows the project's member naming convention.
Properties
- (none)
This struct exposes no properties; only a public field.
Constructors
public TutorialData(int priority)
Initializes a new TutorialData instance and sets m_Priority to the provided priority value.
Methods
- (none)
This type defines no methods. It is a plain data container (POD/blittable) suitable for use in jobs and ECS component data storage.
Usage Example
using Unity.Entities;
using Game.Tutorials;
// Create a TutorialData instance
var tutorial = new TutorialData(10);
// Example: add the component to an entity via an EntityManager
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity someEntity = /* obtain or create entity */;
entityManager.AddComponentData(someEntity, tutorial);
// Example: use in a system (query/filtering)
public partial class TutorialSystem : SystemBase
{
protected override void OnUpdate()
{
// Query entities that have TutorialData
Entities
.WithAll<TutorialData>()
.ForEach((ref TutorialData t) =>
{
// read or modify t.m_Priority here
}).Schedule();
}
}