Answers for "enum as function argument godot"

0

enum as function argument godot

# In the current GDScript version you need to use int as type, 
# but you can still pass it as the enum, like so:

enum Myenum { A, B, C }

func myfunc(value:int):
    print(value)

func _ready():
    myfunc(Myenum.A) # will actually send `0`
    myfunc(Myenum.B) # will actually send `1`
Posted by: Guest on March-14-2022

Code answers related to "enum as function argument godot"

Browse Popular Code Answers by Language