Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ModelController::RecursiveSetAnimation(Node* noed, String ani, bool loop, unsigned char layer)
- {
- if (noed->HasComponent<AnimationController>())
- {
- String fileName = noed->GetVar("fileName").GetString();
- String aniPath = "Models/" + fileName + "/" + ani + ".ani";
- if (main_->cache_->Exists(aniPath))
- {
- if (( (noed->GetComponent<AnimationController>()->IsPlaying(aniPath) == false)
- && (noed->GetComponent<AnimationController>()->IsFadingIn(aniPath) == false) )
- || (noed->GetComponent<AnimationController>()->IsFadingOut(aniPath) == true) )
- {
- noed->GetComponent<AnimationController>()->StopLayer(0, 0.0f);
- noed->GetComponent<AnimationController>()->PlayExclusive(aniPath, layer, loop, 0.0f);
- if (!loop)
- {
- noed->GetComponent<AnimationController>()->SetAutoFade(aniPath, 0.25f);
- }
- }
- else
- {
- return;
- }
- }
- }
- for (int x = 0; x < noed->GetNumChildren(); x++)
- {
- RecursiveSetAnimation(noed->GetChild(x), ani, loop, layer);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement