From 7e3f5cd53bb53f0fd0a365055762d0b17a64cb75 Mon Sep 17 00:00:00 2001 From: jomiq Date: Thu, 1 Dec 2022 12:51:32 +0100 Subject: [PATCH] Change funcref to Callable in example code. --- tutorials/best_practices/godot_interfaces.rst | 6 +++--- tutorials/best_practices/scene_organization.rst | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tutorials/best_practices/godot_interfaces.rst b/tutorials/best_practices/godot_interfaces.rst index 535e62ffc08..b3cde2ef1ea 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 = funcref(self, "print_me") + child.fn = Callable(self, "print_me") child.my_method() func print_me(): @@ -483,7 +483,7 @@ accesses: // Child.cs public class Child : Node { - public FuncRef FN = null; + public Callable FN = null; public void MyMethod() { @@ -500,7 +500,7 @@ accesses: public void _Ready() { Child = GetNode("Child"); - Child.Set("FN", GD.FuncRef(this, "PrintMe")); + Child.Set("FN", GD.Callable(this, "PrintMe")); Child.MyMethod(); } diff --git a/tutorials/best_practices/scene_organization.rst b/tutorials/best_practices/scene_organization.rst index 259f929ee83..d21ca44ba5b 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 = funcref(object_with_method, "method_on_the_object") + $Child.func_property = Callable(object_with_method, "method_on_the_object") # Child func_property.call_func() # Call parent-defined method (can come from anywhere). @@ -104,7 +104,7 @@ initialize it: .. code-tab:: csharp // Parent - GetNode("Child").Set("FuncProperty", GD.FuncRef(ObjectWithMethod, "MethodOnTheObject")); + GetNode("Child").Set("FuncProperty", GD.Callable(ObjectWithMethod, "MethodOnTheObject")); // Child FuncProperty.CallFunc(); // Call parent-defined method (can come from anywhere).