From 88e02928f3dc04cd4808a25e5928a116e9332a8c Mon Sep 17 00:00:00 2001 From: matt08-prog <58103083+matt08-prog@users.noreply.github.com> Date: Thu, 18 May 2023 03:32:07 -0600 Subject: [PATCH] rework two funcref code examples (#6542) Co-authored-by: Max Hilbrunner --- 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 4685c1725..b4552c172 100644 --- a/tutorials/best_practices/godot_interfaces.rst +++ b/tutorials/best_practices/godot_interfaces.rst @@ -478,7 +478,7 @@ accesses: func my_method(): if fn: - fn.call_func() + fn.call() # parent.gd extends Node @@ -486,7 +486,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 07318746e..5cf5d367d 100644 --- a/tutorials/best_practices/scene_organization.rst +++ b/tutorials/best_practices/scene_organization.rst @@ -98,10 +98,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.method_on_the_object # 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