mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Update outdated annotation and setget syntax
Co-Authored-By: PoolloverNathan <24194027+PoolloverNathan@users.noreply.github.com> Co-Authored-By: Solor Vox <1246172+solorvox@users.noreply.github.com>
This commit is contained in:
@@ -240,7 +240,7 @@ tree structures.
|
||||
class_name TreeNode
|
||||
|
||||
var _parent: TreeNode = null
|
||||
var _children: = [] setget
|
||||
var _children := []
|
||||
|
||||
func _notification(p_what):
|
||||
match p_what:
|
||||
@@ -283,7 +283,7 @@ Enumerations: int vs. string
|
||||
|
||||
Most languages offer an enumeration type option. GDScript is no different, but
|
||||
unlike most other languages, it allows one to use either integers or strings for
|
||||
the enum values (the latter only when using the ``export`` keyword in GDScript).
|
||||
the enum values (the latter only when using the ``@export_enum`` annotation in GDScript).
|
||||
The question then arises, "which should one use?"
|
||||
|
||||
The short answer is, "whichever you are more comfortable with." This
|
||||
|
||||
@@ -119,7 +119,7 @@ consider:
|
||||
in exceptional cases, one may wish not to do this:
|
||||
|
||||
1. If the 'imported' class is liable to change, then it should be a property
|
||||
instead, initialized either using an ``export`` or a ``load()`` (and
|
||||
instead, initialized either using an ``@export`` or a ``load()`` (and
|
||||
perhaps not even initialized until later).
|
||||
|
||||
2. If the script requires a great many dependencies, and one does not wish
|
||||
|
||||
Reference in New Issue
Block a user