Game.Rendering.AnimatedTransition
Assembly:
Assembly-CSharp (typical runtime assembly for game code; replace with the actual assembly if different)
Namespace:
Game.Rendering
Type:
struct
Base:
System.ValueType
Summary:
AnimatedTransition is a small, plain data container used by the rendering/animation subsystem to describe a transition between two animation frames/indices. It stores indexes identifying the animation metadata/current and transition targets, the current playback frames for both the active and transitioning animations, and a blend weight used to interpolate between them. This struct is designed for fast copying (value type) and is suitable for use in performance-sensitive code such as animation update loops.
Fields
-
public int m_MetaIndex
Index of the animation metadata or clip entry associated with this transition. Typically maps into an array/table of animation definitions. -
public int m_CurrentIndex
Index of the currently playing animation/state. -
public int m_TransitionIndex
Index of the animation/state being transitioned to (the target of the blend). -
public float m_CurrentFrame
Playback time/frame position of the current animation (in frames or normalized units depending on the system). -
public float m_TransitionFrame
Playback time/frame position of the transitioning (target) animation. -
public float m_TransitionWeight
Blend weight used to interpolate between current and transition animations. Commonly ranges from 0 (only current) to 1 (only transition).
Properties
- This struct defines no properties. It exposes all data via public fields for low-overhead access.
Constructors
public AnimatedTransition()
The default parameterless constructor is the implicitly-provided value-type constructor which initializes all numeric fields to 0. There are no custom constructors declared in the source; create and assign fields manually or use an aggregate initializer.
Methods
- This struct declares no methods. It is intended as a lightweight POD (plain-old-data) structure.
Additional notes: - Size (approximate): 3 ints + 3 floats = 24 bytes (platform- and packing-dependent). - Because it contains only primitive value types, it is blittable and cheap to copy/push in arrays or native interop contexts. - Typical usage is within animation update loops, blending systems, or jobified animation pipelines.
Usage Example
// Create and initialize a transition
Game.Rendering.AnimatedTransition transition = new Game.Rendering.AnimatedTransition
{
m_MetaIndex = 5,
m_CurrentIndex = 0,
m_TransitionIndex = 1,
m_CurrentFrame = 0f,
m_TransitionFrame = 0f,
m_TransitionWeight = 0f
};
// In an update loop, advance frames and update weight
void UpdateTransition(ref Game.Rendering.AnimatedTransition t, float deltaTime, float transitionDuration)
{
t.m_CurrentFrame += deltaTime;
t.m_TransitionFrame += deltaTime;
if (transitionDuration > 0f)
{
t.m_TransitionWeight = Math.Min(1f, t.m_TransitionWeight + deltaTime / transitionDuration);
}
else
{
t.m_TransitionWeight = 1f;
}
}