Browse Source

Merge pull request #79962 from viksl/update-tween-docs

Update C# example of `tween_method` with a parameter to the lambda method
Yuri Sizov 2 years ago
parent
commit
f4b6bc0913
1 changed files with 1 additions and 1 deletions
  1. 1 1
      doc/classes/Tween.xml

+ 1 - 1
doc/classes/Tween.xml

@@ -366,7 +366,7 @@
 				[/gdscript]
 				[/gdscript]
 				[csharp]
 				[csharp]
 				Tween tween = CreateTween();
 				Tween tween = CreateTween();
-				tween.TweenMethod(Callable.From(() => LookAt(Vector3.Up)), new Vector3(-1.0f, 0.0f, -1.0f), new Vector3(1.0f, 0.0f, -1.0f), 1.0f); // The LookAt() method takes up vector as second argument.
+				tween.TweenMethod(Callable.From((Vector3 target) => LookAt(target, Vector3.Up)), new Vector3(-1.0f, 0.0f, -1.0f), new Vector3(1.0f, 0.0f, -1.0f), 1.0f); // Use lambdas to bind additional arguments for the call.
 				[/csharp]
 				[/csharp]
 				[/codeblocks]
 				[/codeblocks]
 				[b]Example:[/b] Setting the text of a [Label], using an intermediate method and after a delay:
 				[b]Example:[/b] Setting the text of a [Label], using an intermediate method and after a delay: