diff options
author | Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> | 2023-05-13 07:20:35 +0900 |
---|---|---|
committer | Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> | 2023-05-15 18:51:45 +0900 |
commit | 238bc9fe1fb6c9fe8b5b7da09181773701a4b583 (patch) | |
tree | a12eb134b0ede95650aeaa628dbcdec366f82cc2 /scene/animation/animation_blend_tree.h | |
parent | 9f12e7b52d944281a39b7d3a33de6700c76cc23a (diff) | |
download | redot-engine-238bc9fe1fb6c9fe8b5b7da09181773701a4b583.tar.gz |
Fix NodeOneShot doesn't respect fade-out when aborting and improvement
Diffstat (limited to 'scene/animation/animation_blend_tree.h')
-rw-r--r-- | scene/animation/animation_blend_tree.h | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/scene/animation/animation_blend_tree.h b/scene/animation/animation_blend_tree.h index e1cba60d7b..25b001e973 100644 --- a/scene/animation/animation_blend_tree.h +++ b/scene/animation/animation_blend_tree.h @@ -100,6 +100,7 @@ public: ONE_SHOT_REQUEST_NONE, ONE_SHOT_REQUEST_FIRE, ONE_SHOT_REQUEST_ABORT, + ONE_SHOT_REQUEST_FADE_OUT, }; enum MixMode { @@ -109,17 +110,21 @@ public: private: double fade_in = 0.0; + Ref<Curve> fade_in_curve; double fade_out = 0.0; + Ref<Curve> fade_out_curve; - bool autorestart = false; - double autorestart_delay = 1.0; - double autorestart_random_delay = 0.0; + bool auto_restart = false; + double auto_restart_delay = 1.0; + double auto_restart_random_delay = 0.0; MixMode mix = MIX_MODE_BLEND; StringName request = PNAME("request"); StringName active = PNAME("active"); + StringName internal_active = PNAME("internal_active"); StringName time = "time"; StringName remaining = "remaining"; + StringName fade_out_remaining = "fade_out_remaining"; StringName time_to_restart = "time_to_restart"; protected: @@ -132,19 +137,25 @@ public: virtual String get_caption() const override; - void set_fadein_time(double p_time); - void set_fadeout_time(double p_time); + void set_fade_in_time(double p_time); + double get_fade_in_time() const; - double get_fadein_time() const; - double get_fadeout_time() const; + void set_fade_in_curve(const Ref<Curve> &p_curve); + Ref<Curve> get_fade_in_curve() const; - void set_autorestart(bool p_active); - void set_autorestart_delay(double p_time); - void set_autorestart_random_delay(double p_time); + void set_fade_out_time(double p_time); + double get_fade_out_time() const; - bool has_autorestart() const; - double get_autorestart_delay() const; - double get_autorestart_random_delay() const; + void set_fade_out_curve(const Ref<Curve> &p_curve); + Ref<Curve> get_fade_out_curve() const; + + void set_auto_restart_enabled(bool p_enabled); + void set_auto_restart_delay(double p_time); + void set_auto_restart_random_delay(double p_time); + + bool is_auto_restart_enabled() const; + double get_auto_restart_delay() const; + double get_auto_restart_random_delay() const; void set_mix_mode(MixMode p_mix); MixMode get_mix_mode() const; |