Game.Prefabs.UtilityObjectData
Assembly:
Assembly-CSharp (default Unity game assembly; actual assembly name may vary)
Namespace:
Game.Prefabs
Type:
struct
Base:
IComponentData, IQueryTypeParameter
Summary:
Component data representing a utility object in the game's ECS. Holds the utility type(s) for the object and its position in world space. This struct is a plain, blittable value type intended for use with Unity.Entities (DOTS) and can be added to entities or used as a query parameter via IQueryTypeParameter.
Fields
-
public UtilityTypes m_UtilityTypes
Holds the utility category or categories for this object (for example water, electricity, sewage, etc.). UtilityTypes is expected to be an enum or flags enum defined elsewhere in the codebase. -
public float3 m_UtilityPosition
The world position of the utility object, using Unity.Mathematics.float3. This stores the location used for utility placement, calculations or spatial queries.
Properties
- This type defines no properties.
Constructors
public UtilityObjectData()
Default (implicit) parameterless constructor provided by C# for structs. Fields will have their default values (m_UtilityTypes default enum value, m_UtilityPosition = float3.zero). No explicit constructors are defined in the source.
Methods
- This type defines no methods.
Usage Example
// Create a UtilityObjectData and add it to an entity via EntityManager
var utilityData = new UtilityObjectData
{
m_UtilityTypes = UtilityTypes.Water, // example enum value
m_UtilityPosition = new Unity.Mathematics.float3(10f, 0f, 20f)
};
EntityManager.AddComponentData(entity, utilityData);
// Or using an EntityCommandBuffer in a job/system:
ecb.SetComponent(entity, utilityData);
Notes: - Because this struct implements IComponentData it is suitable for use in Jobs and Burst-compiled code. - The IQueryTypeParameter implementation indicates the type can be used with certain EntityQuery/iterators APIs as a query parameter in the DOTS framework. - UtilityTypes and exact semantics of m_UtilityPosition depend on other game code and should be consulted in their respective definitions.