Game Development Reference
In-Depth Information
This method is quite straightforward—it tries to find an animation with the name given. If
it fails, it simply returns false . If it succeeds, it uses this animation pointer to switch to
that animation by calling its overload (the one that we just discussed). Finally, it returns
true to indicate to the caller that this animation exists, and the switch was successful.
Animator::FindAnimation() is unremarkable but, for the sake of clarity, we will
have a look at it:
The only thing to note here is that this method returns the first occurrence of an animation
with the same name, which means that we have to be careful when we create animations.
In the current implementation, animations with the same name should be avoided because
it is impossible to access them separately. We can also consider throwing an exception if
we find animations with the same name to improve debugging.
Search WWH ::




Custom Search