瀏覽代碼

Merge pull request #74595 from AurumKitsune/patch-1

Update C# code example to fix an error
Yuri Sizov 2 年之前
父節點
當前提交
2a50f8c107
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      doc/classes/AnimationNodeStateMachinePlayback.xml

+ 1 - 1
doc/classes/AnimationNodeStateMachinePlayback.xml

@@ -12,7 +12,7 @@
 		state_machine.travel("some_state")
 		state_machine.travel("some_state")
 		[/gdscript]
 		[/gdscript]
 		[csharp]
 		[csharp]
-		var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback;
+		var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback").As<AnimationNodeStateMachinePlayback>();
 		stateMachine.Travel("some_state");
 		stateMachine.Travel("some_state");
 		[/csharp]
 		[/csharp]
 		[/codeblocks]
 		[/codeblocks]