Skip to content

Game.Prefabs.WildlifeData

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType
Implements: IComponentData, IQueryTypeParameter

Summary:
WildlifeData is a small ECS component struct that contains configuration parameters used by the wildlife/prefab AI systems to control movement and grouping behavior. It stores a travel distance range (trip length), an idle time range, and a min/max group size. Units for the bounds are determined by the systems that consume this component (commonly distance in game units and time in seconds).


Fields

  • public Bounds1 m_TripLength
    Configuration for how far a wildlife entity should travel when roaming. This represents a minimum/maximum trip length (range). The meaning of the numeric values (distance units) is determined by the systems that read this component.

  • public Bounds1 m_IdleTime
    Idle time range used to pick how long the wildlife entity waits between actions. Typically represents a time range (for example, in seconds) but the exact unit depends on the consumer code.

  • public int2 m_GroupMemberCount
    Integer pair representing minimum and maximum number of members in a wildlife group. Use int2.x (first) as the minimum and int2.y (second) as the maximum.

Properties

  • This struct defines no properties; it exposes three public fields only.

Constructors

  • public WildlifeData()
    As a value type (struct) it has the implicit default constructor that zero-initializes fields. Use an object initializer to set specific values when creating an instance.

Methods

  • This struct defines no methods.

Usage Example

// Example: adding WildlifeData to an Entity (EntityManager usage)
var wildlifeConfig = new WildlifeData
{
    // Initialize Bounds1 according to its API (fields or constructor).
    // Example field-style initializer; if Bounds1 uses a constructor, use that instead.
    m_TripLength = new Bounds1 { min = 10f, max = 50f },   // travel distance range
    m_IdleTime = new Bounds1 { min = 2f,  max = 8f  },     // idle time range
    m_GroupMemberCount = new int2(1, 4)                    // group size range: 1..4
};

entityManager.AddComponentData(wildlifeEntity, wildlifeConfig);

Notes: - Adjust the Bounds1 initialization to match the actual Bounds1 API used in your project (constructor vs fields).
- This component is intended to be read by the wildlife/prefab systems; changing values affects runtime behavior of wildlife entities.