Game.Achievements.ObjectAchievement
Assembly:
Assembly-CSharp.dll (game/mod assembly; compiled into the game's managed assembly)
Namespace:
Game.Achievements
Type:
struct
Base:
System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
ObjectAchievement is a marker/tag component used by the game's ECS (Unity.Entities) to mark entities that are associated with an "object achievement" concept. It is an empty struct with an explicit sequential StructLayout and Size = 1 so it occupies a defined (minimal) size for interop and memory-layout consistency. As a marker component it carries no data; presence or absence on an entity is used to drive logic (queries, systems, achievement handling).
Fields
- None
This struct contains no fields. The StructLayout attribute sets the layout and size but no instance data is stored.
Properties
- None
Note: The type implements IComponentData (so it is a component) and IQueryTypeParameter (so it can be used as a type parameter in entity queries), but it declares no properties.
Constructors
- public ObjectAchievement() (implicit)
Structs in C# have an implicit parameterless constructor. No explicit constructors are declared in the source.
Methods
- None
No methods are defined on this type.
Usage Example
// Add the marker to an entity (EntityManager API)
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
entityManager.AddComponentData(entity, new Game.Achievements.ObjectAchievement());
// Check for presence
if (entityManager.HasComponent<Game.Achievements.ObjectAchievement>(entity))
{
// handle achievement-related logic
}
// Use in a system query (SystemBase)
Entities
.WithAll<Game.Achievements.ObjectAchievement>()
.ForEach((Entity e, in SomeOtherComponent comp) =>
{
// process entities that have the ObjectAchievement tag
}).Schedule();
Additional notes: - Because this is a tag component, prefer AddComponent/RemoveComponent/WithAll/WithNone query helpers to drive logic rather than inspecting stored data. - The StructLayout(Size = 1) attribute ensures the type has a defined non-zero size for interop or other systems that expect a non-zero-sized struct.