GDScript: Allow access to outer constant and enum values

This commit is contained in:
George Marques
2021-08-24 13:58:06 -03:00
parent 6609ce1944
commit 4918df4527
7 changed files with 81 additions and 9 deletions
@@ -0,0 +1,14 @@
extends Node
enum Named { VALUE_A, VALUE_B, VALUE_C = 42 }
class Test:
var a = Named.VALUE_A
var b = Named.VALUE_B
var c = Named.VALUE_C
func test():
var test_instance = Test.new()
prints("a", test_instance.a, test_instance.a == Named.VALUE_A)
prints("b", test_instance.b, test_instance.b == Named.VALUE_B)
prints("c", test_instance.c, test_instance.c == Named.VALUE_C)