Game.Prefabs.JournalEventPrefabData
Assembly:
Assembly-CSharp
Namespace:
Game.Prefabs
Type:
struct
Base:
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
A plain ECS component type used to store prefab-level flag data for "journal events" in the game. Contains two integer fields that act as bitflags (or small integer flags) describing data/state and effect categories for a journal event prefab. As an IComponentData it is intended to be attached to entities (prefabs) and used in Entity queries; implementing IQueryTypeParameter allows it to be used directly in some query APIs.
Fields
-
public int m_DataFlags
Bitfield / flags representing data-related properties for the journal event prefab. The exact bit meanings are defined elsewhere in the game's codebase; treat this as an opaque set of flags unless you locate the constants or enum values that map to individual bits. -
public int m_EffectFlags
Bitfield / flags representing effect-related properties attached to the journal event prefab (for example visual/audio/effect categories). As with m_DataFlags, the specific bit definitions must be determined from other parts of the game's source or metadata.
Properties
- None. This type exposes only public fields.
Constructors
public JournalEventPrefabData()
The default value-type constructor is present implicitly. Create and initialize using object initializer syntax if you need to set flags at creation time:
var data = new JournalEventPrefabData
{
m_DataFlags = 0,
m_EffectFlags = 0
};
Methods
- None. This struct contains no methods.
Usage Example
using Unity.Entities;
using Game.Prefabs;
// Add the component to an existing entity (e.g., a prefab entity) with specific flags:
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity myPrefabEntity = /* obtain or create entity representing the prefab */;
var journalData = new JournalEventPrefabData
{
m_DataFlags = 1 << 0, // example: set bit 0 (interpretation depends on game constants)
m_EffectFlags = 1 << 2 // example: set bit 2
};
entityManager.AddComponentData(myPrefabEntity, journalData);
// Read the component later in a system:
var readData = entityManager.GetComponentData<JournalEventPrefabData>(myPrefabEntity);
bool hasSomeDataFlag = (readData.m_DataFlags & (1 << 0)) != 0;
Notes and tips: - Because the fields are simple ints and the struct implements IComponentData, it is safe and efficient to use in Jobs and ECS systems. - The meaning of individual bits is not encoded in this struct; search the game's codebase for constants, enums, or comments naming corresponding flag values (commonly named DataFlags, EffectFlags, etc.) before manipulating bits with hardcoded indices. - When creating or modifying prefab components, prefer doing so during initialization or in editor tools rather than at runtime per-frame to avoid unnecessary structural changes to entities.