mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
GDScript: Add error when exporting node in non [Node]-derived classes
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# GH-82809
|
||||
|
||||
extends Resource
|
||||
|
||||
@export var node: Node
|
||||
|
||||
func test():
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Node export is only supported in Node-derived classes, but the current class inherits "Resource".
|
||||
@@ -0,0 +1,9 @@
|
||||
# GH-82809
|
||||
|
||||
extends Node
|
||||
|
||||
class Inner:
|
||||
@export var node: Node
|
||||
|
||||
func test():
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Node export is only supported in Node-derived classes, but the current class inherits "RefCounted".
|
||||
@@ -0,0 +1,8 @@
|
||||
# GH-82809
|
||||
|
||||
extends Resource
|
||||
|
||||
@export var node_array: Array[Node]
|
||||
|
||||
func test():
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Node export is only supported in Node-derived classes, but the current class inherits "Resource".
|
||||
@@ -1,3 +1,5 @@
|
||||
extends Node
|
||||
|
||||
@export var example = 99
|
||||
@export_range(0, 100) var example_range = 100
|
||||
@export_range(0, 100, 1) var example_range_step = 101
|
||||
@@ -6,7 +8,8 @@
|
||||
@export var color: Color
|
||||
@export_color_no_alpha var color_no_alpha: Color
|
||||
@export_node_path("Sprite2D", "Sprite3D", "Control", "Node") var nodepath := ^"hello"
|
||||
|
||||
@export var node: Node
|
||||
@export var node_array: Array[Node]
|
||||
|
||||
func test():
|
||||
print(example)
|
||||
@@ -16,3 +19,5 @@ func test():
|
||||
print(color)
|
||||
print(color_no_alpha)
|
||||
print(nodepath)
|
||||
print(node)
|
||||
print(var_to_str(node_array))
|
||||
|
||||
@@ -6,3 +6,5 @@ GDTEST_OK
|
||||
(0, 0, 0, 1)
|
||||
(0, 0, 0, 1)
|
||||
hello
|
||||
<null>
|
||||
Array[Node]([])
|
||||
|
||||
Reference in New Issue
Block a user