GDScript: Access outer scope classes
This commit is contained in:
parent
cb85ef6c38
commit
0ff0f64cd4
3 changed files with 28 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
class A:
|
||||
var x = 3
|
||||
|
||||
class B:
|
||||
var x = 4
|
||||
|
||||
class C:
|
||||
var x = 5
|
||||
|
||||
class Test:
|
||||
var a = A.new()
|
||||
var b: B = B.new()
|
||||
var c := C.new()
|
||||
|
||||
func test():
|
||||
var test_instance := Test.new()
|
||||
prints(test_instance.a.x)
|
||||
prints(test_instance.b.x)
|
||||
prints(test_instance.c.x)
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
GDTEST_OK
|
||||
3
|
||||
4
|
||||
5
|
||||
Loading…
Add table
Add a link
Reference in a new issue