mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Update certain example code snippets to use the new syntax
This commit is contained in:
@@ -131,7 +131,7 @@ It uses the NavigationServer2D and a NavigationAgent2D for path movement.
|
||||
navigation_agent.target_desired_distance = 4.0
|
||||
|
||||
# Make sure to not await during _ready.
|
||||
call_deferred("actor_setup")
|
||||
actor_setup.call_deferred()
|
||||
|
||||
func actor_setup():
|
||||
# Wait for the first physics frame so the NavigationServer can sync.
|
||||
|
||||
@@ -132,7 +132,7 @@ It uses the NavigationServer3D and a NavigationAgent3D for path movement.
|
||||
navigation_agent.target_desired_distance = 0.5
|
||||
|
||||
# Make sure to not await during _ready.
|
||||
call_deferred("actor_setup")
|
||||
actor_setup.call_deferred()
|
||||
|
||||
func actor_setup():
|
||||
# Wait for the first physics frame so the NavigationServer can sync.
|
||||
|
||||
@@ -97,7 +97,7 @@ Afterwards the function waits for the next physics frame before continuing with
|
||||
func _ready():
|
||||
# Use call deferred to make sure the entire scene tree nodes are setup
|
||||
# else await on 'physics_frame' in a _ready() might get stuck.
|
||||
call_deferred("custom_setup")
|
||||
custom_setup.call_deferred()
|
||||
|
||||
func custom_setup():
|
||||
|
||||
|
||||
Reference in New Issue
Block a user