add 3.x compatibility for animation loop mode

(cherry picked from commit 1686a7a1a2)
This commit is contained in:
Chinmay Awale 2023-07-07 17:45:11 +05:30 committed by Yuri Sizov
parent 36ce14a826
commit 4f4052581b
1 changed files with 5 additions and 0 deletions

View File

@ -427,6 +427,11 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) {
} else { } else {
return false; return false;
} }
#ifndef DISABLE_DEPRECATED
} else if (prop_name == "loop" && p_value.operator bool()) { // Compatibility with Godot 3.x.
loop_mode = Animation::LoopMode::LOOP_LINEAR;
return true;
#endif // DISABLE_DEPRECATED
} else { } else {
return false; return false;
} }