From 2540cda5d174ae8e30d3dedb0c96c4e837b481ca Mon Sep 17 00:00:00 2001 From: matt08-prog Date: Fri, 30 Dec 2022 18:57:08 -0700 Subject: [PATCH 1/3] rework two funcref code examples --- tutorials/best_practices/godot_interfaces.rst | 4 ++-- tutorials/best_practices/scene_organization.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/best_practices/godot_interfaces.rst b/tutorials/best_practices/godot_interfaces.rst index 535e62ffc08..bfd40e3c196 100644 --- a/tutorials/best_practices/godot_interfaces.rst +++ b/tutorials/best_practices/godot_interfaces.rst @@ -464,7 +464,7 @@ accesses: func my_method(): if fn: - fn.call_func() + fn.call() # parent.gd extends Node @@ -472,7 +472,7 @@ accesses: @onready var child = $Child func _ready(): - child.fn = funcref(self, "print_me") + child.fn = print_me() child.my_method() func print_me(): diff --git a/tutorials/best_practices/scene_organization.rst b/tutorials/best_practices/scene_organization.rst index 259f929ee83..90e0fce8a0e 100644 --- a/tutorials/best_practices/scene_organization.rst +++ b/tutorials/best_practices/scene_organization.rst @@ -96,10 +96,10 @@ initialize it: .. code-tab:: gdscript GDScript # Parent - $Child.func_property = funcref(object_with_method, "method_on_the_object") + $Child.func_property = object_with_method() # Child - func_property.call_func() # Call parent-defined method (can come from anywhere). + func_property.call() # Call parent-defined method (can come from anywhere). .. code-tab:: csharp From e07692d8a447105c84ac2380e9abc97db727df8c Mon Sep 17 00:00:00 2001 From: Max Hilbrunner Date: Thu, 18 May 2023 11:28:32 +0200 Subject: [PATCH 2/3] Update tutorials/best_practices/scene_organization.rst --- tutorials/best_practices/scene_organization.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/best_practices/scene_organization.rst b/tutorials/best_practices/scene_organization.rst index 90e0fce8a0e..bb3e5b73891 100644 --- a/tutorials/best_practices/scene_organization.rst +++ b/tutorials/best_practices/scene_organization.rst @@ -96,7 +96,7 @@ initialize it: .. code-tab:: gdscript GDScript # Parent - $Child.func_property = object_with_method() + $Child.func_property = object_with_method.method_on_the_object # Child func_property.call() # Call parent-defined method (can come from anywhere). From 4ca808b89fe80b87496042ce7bd42a5c6efc04a8 Mon Sep 17 00:00:00 2001 From: Max Hilbrunner Date: Thu, 18 May 2023 11:28:38 +0200 Subject: [PATCH 3/3] Update tutorials/best_practices/godot_interfaces.rst --- tutorials/best_practices/godot_interfaces.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/best_practices/godot_interfaces.rst b/tutorials/best_practices/godot_interfaces.rst index bfd40e3c196..ca596e194e8 100644 --- a/tutorials/best_practices/godot_interfaces.rst +++ b/tutorials/best_practices/godot_interfaces.rst @@ -472,7 +472,7 @@ accesses: @onready var child = $Child func _ready(): - child.fn = print_me() + child.fn = print_me child.my_method() func print_me():