aboutsummaryrefslogtreecommitdiff
path: root/scene/animation/animation_player.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2017-08-20 12:55:46 -0300
committerGitHub2017-08-20 12:55:46 -0300
commit541fdffc0ab2115238fe9cedbf1c088b15f11fdf (patch)
tree187c5d0278e5075907fef8a86b4d00d6a0b7161a /scene/animation/animation_player.cpp
parent831e21e89ba0275b43b6a351e538256b8ce715a3 (diff)
parent90b8a5b71ef79e0339826507c4b290f0c51b7cd2 (diff)
downloadgodot-541fdffc0ab2115238fe9cedbf1c088b15f11fdf.tar.gz
godot-541fdffc0ab2115238fe9cedbf1c088b15f11fdf.tar.zst
godot-541fdffc0ab2115238fe9cedbf1c088b15f11fdf.zip
Diffstat (limited to 'scene/animation/animation_player.cpp')
-rw-r--r--scene/animation/animation_player.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index e2a063646..b111fb881 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "animation_player.h"
+#include "engine.h"
#include "message_queue.h"
#include "scene/scene_string_names.h"
@@ -199,7 +200,7 @@ void AnimationPlayer::_notification(int p_what) {
} break;
case NOTIFICATION_READY: {
- if (!get_tree()->is_editor_hint() && animation_set.has(autoplay)) {
+ if (!Engine::get_singleton()->is_editor_hint() && animation_set.has(autoplay)) {
play(autoplay);
set_autoplay(""); //this line is the fix for autoplay issues with animatio
_animation_process(0);
@@ -344,7 +345,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float
ERR_FAIL_COND(p_anim->node_cache.size() != p_anim->animation->get_track_count());
Animation *a = p_anim->animation.operator->();
- bool can_call = is_inside_tree() && !get_tree()->is_editor_hint();
+ bool can_call = is_inside_tree() && !Engine::get_singleton()->is_editor_hint();
for (int i = 0; i < a->get_track_count(); i++) {
@@ -955,7 +956,7 @@ void AnimationPlayer::play(const StringName &p_name, float p_custom_blend, float
emit_signal(SceneStringNames::get_singleton()->animation_started, c.assigned);
- if (is_inside_tree() && get_tree()->is_editor_hint())
+ if (is_inside_tree() && Engine::get_singleton()->is_editor_hint())
return; // no next in this case
StringName next = animation_get_next(p_name);