Clear seeked/started flag after seeking/advancing in AnimationPlayer

This commit is contained in:
Silc Lizard (Tokage) Renew 2023-11-22 23:08:21 +09:00
parent 80de898d72
commit 9c3104292d
2 changed files with 9 additions and 0 deletions

View File

@ -534,12 +534,19 @@ void AnimationPlayer::seek(double p_time, bool p_update, bool p_update_only) {
}
}
playback.started = false; // Start has already gone by seeking, delta does not need to be 0 in the internal process.
playback.seeked = true;
if (p_update) {
_process_animation(0, p_update_only);
playback.seeked = false; // If animation was proceeded here, no more seek in internal process.
}
}
void AnimationPlayer::advance(double p_time) {
playback.started = false; // Start has already gone by advancing, delta does not need to be 0 in the internal process.
AnimationMixer::advance(p_time);
}
bool AnimationPlayer::is_valid() const {
return (playback.current.from);
}

View File

@ -183,6 +183,8 @@ public:
void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
virtual void advance(double p_time) override;
AnimationPlayer();
~AnimationPlayer();
};