mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Update gdscript_exports.rst
Remove bogus information. Just tested it. No form of declaration causes an array to be shared across instances. Godot 3.2.2
This commit is contained in:
committed by
GitHub
parent
9b6dfa766a
commit
a5f313fbe6
@@ -165,11 +165,7 @@ If in doubt, use boolean variables instead.
|
||||
Exporting arrays
|
||||
----------------
|
||||
|
||||
Exporting arrays works, but with an important caveat: while regular
|
||||
arrays are created local to every class instance, exported arrays are *shared*
|
||||
between all instances. This means that editing them in one instance will
|
||||
cause them to change in all other instances. Exported arrays can have
|
||||
initializers, but they must be constant expressions.
|
||||
Exported arrays can have initializers, but they must be constant expressions.
|
||||
|
||||
If the exported array specifies a type which inherits from Resource, the array
|
||||
values can be set in the inspector by dragging and dropping multiple files
|
||||
@@ -177,7 +173,6 @@ from the FileSystem dock at once.
|
||||
|
||||
::
|
||||
|
||||
# Exported array, shared between all instances.
|
||||
# Default value must be a constant expression.
|
||||
|
||||
export var a = [1, 2, 3]
|
||||
@@ -204,7 +199,6 @@ from the FileSystem dock at once.
|
||||
export var vector3s = PackedVector3Array()
|
||||
export var strings = PackedStringArray()
|
||||
|
||||
# Regular array, created local for every instance.
|
||||
# Default value can include run-time values, but can't
|
||||
# be exported.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user