Skip to content

Game.ObjectSelectionActivationData

Assembly: Assembly-CSharp
Namespace: Game.Tutorials

Type: struct

Base: System.ValueType, implements Unity.Entities.IBufferElementData

Summary:
A lightweight ECS buffer element used by the tutorial system to represent an object-selection activation entry. It stores a reference to a prefab Entity and a flag indicating whether the associated tool is allowed when this tutorial selection is active. Intended to be used in DynamicBuffer on entities that drive tutorial behavior or object selection workflows.


Fields

  • public Entity m_Prefab
    Reference to the prefab Entity that should be selected/activated by the tutorial entry. Typically this is an Entity created from a prefab converted into ECS (e.g., via GameObjectConversion).

  • public bool m_AllowTool
    Flag indicating whether the selection activation permits (or requires) using the in-game tool. True means the tool is allowed/active for this tutorial entry; false means no tool should be used.

Properties

  • This struct does not define any properties. It exposes raw public fields suitable for use in Unity.Entities.DynamicBuffer.

Constructors

  • public ObjectSelectionActivationData(Entity prefab, bool allowTool)
    Creates a new buffer element instance initializing the prefab reference and the allow-tool flag.

Methods

  • This struct does not define any methods. It's a plain data container (IBufferElementData) intended for storage in DynamicBuffer.

Usage Example

// Add a DynamicBuffer<ObjectSelectionActivationData> to an entity and push an entry.
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity tutorialEntity = entityManager.CreateEntity();
var buffer = entityManager.AddBuffer<ObjectSelectionActivationData>(tutorialEntity);

// Suppose 'prefabEntity' is an Entity representing the tutorial target prefab.
Entity prefabEntity = /* obtained from conversion or entity lookup */;
buffer.Add(new ObjectSelectionActivationData(prefabEntity, allowTool: true));

// In a System, you can iterate buffers:
Entities.ForEach((ref DynamicBuffer<ObjectSelectionActivationData> buf) =>
{
    foreach (var entry in buf)
    {
        // Use entry.m_Prefab and entry.m_AllowTool to drive tutorial logic
    }
}).WithoutBurst().Run();