瀏覽代碼

Merge pull request #27162 from guilhermefelipecgs/fix_26540

StateMachine: Fix sync mode
Rémi Verschelde 6 年之前
父節點
當前提交
1b4204fd76
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      scene/animation/animation_node_state_machine.cpp

+ 3 - 3
scene/animation/animation_node_state_machine.cpp

@@ -440,13 +440,13 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm,
 
 		bool goto_next = false;
 
-		if (switch_mode == AnimationNodeStateMachineTransition::SWITCH_MODE_IMMEDIATE) {
-			goto_next = fading_from == StringName();
-		} else {
+		if (switch_mode == AnimationNodeStateMachineTransition::SWITCH_MODE_AT_END) {
 			goto_next = next_xfade >= (len_current - pos_current) || loops_current > 0;
 			if (loops_current > 0) {
 				next_xfade = 0;
 			}
+		} else {
+			goto_next = fading_from == StringName();
 		}
 
 		if (goto_next) { //loops should be used because fade time may be too small or zero and animation may have looped