mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Updated gdscript (markdown)
parent
0dd0b83fd2
commit
3deeec5132
@ -531,15 +531,17 @@ It must be noted that even if the script is not being run while at the editor, t
|
||||
|
||||
#### Exporting Arrays
|
||||
|
||||
Exporting arrays works too but there is a restriction. While regular arrays are created local to every 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.
|
||||
Exporting arrays works too but there is a restriction. While regular arrays are created local to every 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.
|
||||
|
||||
|
||||
```python
|
||||
# exported array, shared between all instances. Default value must be a constant expression.
|
||||
# Exported array, shared between all instances.
|
||||
# Default value must be a constant expression.
|
||||
|
||||
export var a=[1,2,3]
|
||||
|
||||
# regular array, created local for every instance and default value can include run-time values.
|
||||
# Regular array, created local for every instance.
|
||||
# Default value can include run-time values.
|
||||
|
||||
var b = [a,2,3]
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user