rework two funcref code examples (#6542)

Co-authored-by: Max Hilbrunner <mhilbrunner@users.noreply.github.com>
This commit is contained in:
matt08-prog
2023-05-18 11:32:07 +02:00
committed by GitHub
co-authored by Max Hilbrunner
parent 4fa13df80f
commit 88e02928f3
2 changed files with 4 additions and 4 deletions
@@ -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():
@@ -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