File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,16 @@ void Tween::kill() {
200
200
running = false ; // For the sake of is_running().
201
201
valid = false ;
202
202
dead = true ;
203
+
204
+ // Kill all subtweens of this tween.
205
+ for (List<Ref<Tweener>> &tweener : tweeners) {
206
+ for (Ref<Tweener> &indiv_tweener : tweener) {
207
+ SubtweenTweener *as_subtween_tweener = Object::cast_to<SubtweenTweener>(indiv_tweener.ptr ());
208
+ if (as_subtween_tweener) {
209
+ as_subtween_tweener->subtween ->kill ();
210
+ }
211
+ }
212
+ }
203
213
}
204
214
205
215
bool Tween::is_running () {
@@ -212,6 +222,16 @@ bool Tween::is_valid() {
212
222
213
223
void Tween::clear () {
214
224
valid = false ;
225
+
226
+ // Clear all subtweens of this tween.
227
+ for (List<Ref<Tweener>> &tweener : tweeners) {
228
+ for (Ref<Tweener> &indiv_tweener : tweener) {
229
+ SubtweenTweener *as_subtween_tweener = Object::cast_to<SubtweenTweener>(indiv_tweener.ptr ());
230
+ if (as_subtween_tweener) {
231
+ as_subtween_tweener->subtween ->clear ();
232
+ }
233
+ }
234
+ }
215
235
tweeners.clear ();
216
236
}
217
237
You can’t perform that action at this time.
0 commit comments