瀏覽代碼

add 3.x compatibility for animation loop mode

Chinmay Awale 2 年之前
父節點
當前提交
1686a7a1a2
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      scene/resources/animation.cpp

+ 5 - 0
scene/resources/animation.cpp

@@ -427,6 +427,11 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) {
 		} else {
 			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 {
 		return false;
 	}