本文整理汇总了C++中Animation::GetAnimationNameHash方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::GetAnimationNameHash方法的具体用法?C++ Animation::GetAnimationNameHash怎么用?C++ Animation::GetAnimationNameHash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animation
的用法示例。
在下文中一共展示了Animation::GetAnimationNameHash方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAnimationState
AnimationState* AnimatedModel::GetAnimationState(StringHash animationNameHash) const
{
for (Vector<SharedPtr<AnimationState> >::ConstIterator i = animationStates_.Begin(); i != animationStates_.End(); ++i)
{
Animation* animation = (*i)->GetAnimation();
if (animation)
{
// Check both the animation and the resource name
if (animation->GetNameHash() == animationNameHash || animation->GetAnimationNameHash() == animationNameHash)
return *i;
}
}
return nullptr;
}
示例2: GetAnimationState
AnimationState* AnimationController::GetAnimationState(StringHash nameHash) const
{
// Model mode
AnimatedModel* model = GetComponent<AnimatedModel>();
if (model)
return model->GetAnimationState(nameHash);
// Node hierarchy mode
for (Vector<SharedPtr<AnimationState> >::ConstIterator i = nodeAnimationStates_.Begin(); i != nodeAnimationStates_.End(); ++i)
{
Animation* animation = (*i)->GetAnimation();
if (animation->GetNameHash() == nameHash || animation->GetAnimationNameHash() == nameHash)
return *i;
}
return 0;
}
示例3: GetAnimationState
AnimationState* AnimationController::GetAnimationState(StringHash nameHash) const
{
// Model mode
auto* model = GetComponent<AnimatedModel>();
if (model)
return model->GetAnimationState(nameHash);
// Node hierarchy mode
for (auto i = nodeAnimationStates_.begin(); i != nodeAnimationStates_.end(); ++i)
{
Animation* animation = (*i)->GetAnimation();
if (animation->GetNameHash() == nameHash || animation->GetAnimationNameHash() == nameHash)
return *i;
}
return nullptr;
}
示例4: RemoveAnimationState
void AnimatedModel::RemoveAnimationState(StringHash animationNameHash)
{
for (Vector<SharedPtr<AnimationState> >::Iterator i = animationStates_.Begin(); i != animationStates_.End(); ++i)
{
AnimationState* state = *i;
Animation* animation = state->GetAnimation();
if (animation)
{
// Check both the animation and the resource name
if (animation->GetNameHash() == animationNameHash || animation->GetAnimationNameHash() == animationNameHash)
{
animationStates_.Erase(i);
MarkAnimationDirty();
return;
}
}
}
}