本文整理汇总了C++中FAnimMontageInstance::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ FAnimMontageInstance::Initialize方法的具体用法?C++ FAnimMontageInstance::Initialize怎么用?C++ FAnimMontageInstance::Initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FAnimMontageInstance
的用法示例。
在下文中一共展示了FAnimMontageInstance::Initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Montage_Play
/** Play a Montage. Returns Length of Montage in seconds. Returns 0.f if failed to play. */
float UAnimInstance::Montage_Play(UAnimMontage * MontageToPlay, float InPlayRate)
{
if( MontageToPlay && (MontageToPlay->SequenceLength > 0.f) )
{
if( CurrentSkeleton->IsCompatible(MontageToPlay->GetSkeleton()) )
{
// when stopping old animations, make sure it does give current new blendintime to blend out
StopAllMontages(MontageToPlay->BlendInTime);
FAnimMontageInstance * NewInstance = new FAnimMontageInstance(this);
check (NewInstance);
NewInstance->Initialize(MontageToPlay);
NewInstance->Play(InPlayRate);
MontageInstances.Add(NewInstance);
UpdateRootMotionMontageInstance();
return NewInstance->Montage->SequenceLength;
}
else
{
UE_LOG(LogAnimation, Warning, TEXT("Playing a Montage (%s) for the wrong Skeleton (%s) instead of (%s)."),
*GetNameSafe(MontageToPlay), *GetNameSafe(MontageToPlay->GetSkeleton()), *GetNameSafe(CurrentSkeleton));
}
}
else
{
UE_LOG(LogAnimation, Warning, TEXT("Trying to play invalid Montage (%s)"), *GetNameSafe(MontageToPlay));
}
return 0.f;
}