constants_from_parent.gd 412 B

12345678910111213141516
  1. extends Node
  2. const NO_TYPE_CONST = 0
  3. const TYPE_CONST: int = 1
  4. const GUESS_TYPE_CONST := 2
  5. class Test:
  6. var a = NO_TYPE_CONST
  7. var b = TYPE_CONST
  8. var c = GUESS_TYPE_CONST
  9. func test():
  10. var test_instance = Test.new()
  11. prints("a", test_instance.a, test_instance.a == NO_TYPE_CONST)
  12. prints("b", test_instance.b, test_instance.b == TYPE_CONST)
  13. prints("c", test_instance.c, test_instance.c == GUESS_TYPE_CONST)