Game.CharacterStyleData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
CharacterStyleData is a plain data component used on character/pedestrian prefabs to describe animation- and geometry-related metadata for a character style. It contains bitmasks that drive which activities and animation layers apply, counts for skeleton bones and shape/blend targets, and an index pointing to a rest-pose animation clip. This struct is intended to be attached to entities (IComponentData) and can be used as a type parameter in queries (IQueryTypeParameter).
Fields
-
public ActivityMask m_ActivityMask
Describes which activities this character style supports. Typically a bitmask where each bit corresponds to a high-level activity/category (e.g., walking, running, idling). Used by animation/AI systems to filter applicable styles or clips. -
public AnimationLayerMask m_AnimationLayerMask
Defines which animation layers are active or relevant for this style. Layer masks control blending and which sets of animations (upper body, lower body, additive layers, etc.) should be applied. -
public int m_BoneCount
Number of bones in the character skeleton relevant to this style. Used to size buffers or validate skinning data and animation bindings. -
public int m_ShapeCount
Number of shape/blend targets (morph targets) available for this character. Used when applying blendshape-based facial expressions or body shape variations. -
public int m_RestPoseClipIndex
Index of the animation clip that represents the rest (bind) pose for this style. Systems use this index to retrieve the rest-pose clip for normalization, retargeting, or as a fallback.
Properties
- This type defines no properties.
Constructors
public CharacterStyleData()
Struct has the implicit parameterless constructor that initializes numeric fields to 0 and reference/value-type fields to their default values. For meaningful use, populate fields explicitly when creating an instance.
Methods
- This type declares no methods. It's a pure data container (IComponentData) with no behavior.
Usage Example
// Construct and attach to an entity (requires Unity.Entities APIs and a valid Entity / EntityManager)
var style = new Game.Prefabs.CharacterStyleData
{
m_ActivityMask = myActivityMask,
m_AnimationLayerMask = myLayerMask,
m_BoneCount = 32,
m_ShapeCount = 10,
m_RestPoseClipIndex = 0
};
entityManager.AddComponentData(characterEntity, style);
// Example: Querying entities with this component in a SystemBase
Entities
.WithAll<Game.Prefabs.CharacterStyleData>()
.ForEach((ref Game.Prefabs.CharacterStyleData csd) =>
{
// read or modify csd fields here
}).Schedule();
{{ Notes: This struct is intended as a lightweight, unmanaged component for ECS. The exact semantics of ActivityMask and AnimationLayerMask are project-specific; consult the animation/character systems for the bit assignments and clip indexing conventions. }}