From bae843a1c9dadad2b40e17f1e44e13eb01d65f97 Mon Sep 17 00:00:00 2001 From: HaSa1002 Date: Sat, 28 Nov 2020 00:33:15 +0100 Subject: Docs: Port Code Examples to C# (R, S, T, U) * RenderingServer * RichTextEffect * SceneTree * SceneTreeTimer * ScriptCreateDialog * SpinBox * Sprite2D * StreamPeer * String * SurfaceTool * TextEdit * TileMap * Tree * Tween * UDPServer * UndoRedo Co-authored-by: Aaron Franke --- doc/classes/SceneTree.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'doc/classes/SceneTree.xml') diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index c54e2f4b88..72a42202c7 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -69,12 +69,22 @@ Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this [SceneTree]. If [code]process_always[/code] is set to [code]false[/code], pausing the [SceneTree] will also pause the timer. Commonly used to create a one-shot delay timer as in the following example: - [codeblock] + [codeblocks] + [gdscript] func some_function(): print("start") yield(get_tree().create_timer(1.0), "timeout") print("end") - [/codeblock] + [/gdscript] + [csharp] + public async void SomeFunction() + { + GD.Print("start"); + await ToSignal(GetTree().CreateTimer(1.0f), "timeout"); + GD.Print("end"); + } + [/csharp] + [/codeblocks] The timer will be automatically freed after its time elapses. -- cgit v1.2.3