void AnimController::freeze() { if (!_freezing) { _freezing = true; status_cache.clear(); for (Map<StringName, Node*>::Element *E = anim_nodes.front(); E; E=E->next()) { AnimationPlayer *player = E->get()->cast_to<AnimationPlayer>(); if (player->is_playing()) { AnimationStatus status; status.name = player->get_current_animation(); status.position = player->get_current_animation_pos(); status.player = player; status_cache.push_back(status); player->stop(false); player->set_active(false); } } } }