Skip to content

Game.Rendering.AnimatedTransition2

Assembly: Game (assembly containing runtime rendering types)
Namespace: Game.Rendering

Type: struct

Base: System.ValueType

Summary:
Represents a compact description of a two-way animated transition used by the rendering/animation pipeline. Stores indices, per-transition frame positions and blend weights, plus metadata and the currently active animation/frame. Designed to be lightweight and suitable for use in arrays, jobs and Burst-compiled code.


Fields

  • public Unity.Mathematics.int2 m_TransitionIndex
    Indexes identifying the two transitions/animations being blended. Typically contains the source and target animation indices (or frame-set indices) used by the renderer.

  • public Unity.Mathematics.float2 m_TransitionFrame
    Per-transition frame/time values for each of the two blended animations. Units depend on the animation system (usually frames or time in seconds).

  • public Unity.Mathematics.float2 m_TransitionWeight
    Blend weights for the two transitions. Values are commonly normalized so that m_TransitionWeight.x + m_TransitionWeight.y == 1, but normalization is the caller's responsibility.

  • public int m_MetaIndex
    Index into a metadata table (for example animation metadata, group, or lookup table) associated with this transition.

  • public int m_CurrentIndex
    Index of the currently active animation or frame-set (the one considered "current" for playback).

  • public float m_CurrentFrame
    Current frame/time of the active animation referenced by m_CurrentIndex.

Properties

  • public Unity.Jobs.JobHandle producerHandle { get; private set }
    This type has no properties. (The example property in the template is not present on this struct.)

Constructors

  • public AnimatedTransition2()
    No explicit constructor is defined in the source — the default parameterless constructor is used (fields are zero-initialized). Initialize explicitly when needed.

Methods

  • protected virtual OnCreate() : System.Void
    This struct defines no methods.

Usage Example

using Unity.Mathematics;
using Game.Rendering;

// Create and initialize a two-way transition
var transition = new AnimatedTransition2
{
    m_TransitionIndex = new int2(3, 7),           // animation indices
    m_TransitionFrame = new float2(0f, 12.5f),    // frames/times for each animation
    m_TransitionWeight = new float2(0.8f, 0.2f),  // blend weights (caller may normalize)
    m_MetaIndex = 1,
    m_CurrentIndex = 3,
    m_CurrentFrame = 0f
};

// Normalize weights (optional, caller responsibility)
float sum = transition.m_TransitionWeight.x + transition.m_TransitionWeight.y;
if (sum > 0f)
{
    transition.m_TransitionWeight /= sum;
}

// Use in an array (suitable for Jobs/Burst)
AnimatedTransition2[] transitions = new AnimatedTransition2[1024];
transitions[0] = transition;

Notes and tips: - The struct is composed of primitive and Unity.Mathematics types and is blittable — appropriate for use in Unity Jobs, Burst, and GPU upload workflows when a matching memory layout is expected. - No thread-safety guarantees: when used in multi-threaded contexts, perform proper synchronization or use jobified data containers. - The struct does not include helper functions (normalization, interpolation). Keep such logic in utility methods or systems that operate on instances of this struct.