private void FadeAnimations( Real deltaTime )
{
for ( int i = 0; i < NumAnims; i++ )
{
if ( fadingIn[ i ] )
{
// slowly fade this animation in until it has full weight
Real newWeight = anims[ i ].Weight + deltaTime * AnimFadeSpeed;
anims[ i ].Weight = Utility.Clamp<Real>( newWeight, 1, 0 );
if ( newWeight >= 1 )
fadingIn[ i ] = false;
}
else if ( fadingOut[ i ] )
{
// slowly fade this animation out until it has no weight, and then disable it
Real newWeight = anims[ i ].Weight - deltaTime * AnimFadeSpeed;
anims[ i ].Weight = Utility.Clamp<Real>( newWeight, 1, 0 );
if ( newWeight <= 0 )
{
anims[ i ].IsEnabled = false;
fadingOut[ i ] = false;
}
}
}
}