Logo
Explore Help
Sign In
seedlingattempt/godot
1
0
Fork 0
You've already forked godot
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
a7029e4c8a0714400deb40ec6d57b31c2025d22e
godot/modules/gdscript/tests/scripts/runtime/features/static_variables_load.gd

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
167 B
GDScript3
Raw Normal View History

Add support for static variables in GDScript Which allows editable data associated with a particular class instead of the instance. Scripts with static variables are kept in memory indefinitely unless the `@static_unload` annotation is used or the `static_unload()` method is called on the GDScript. If the custom function `_static_init()` exists it will be called when the class is loaded, after the static variables are set.
2023-04-19 11:10:35 -03:00
@static_unload
static var perm := 0
static var prop := "Hello!":
get: return prop + " suffix"
set(value): prop = "prefix " + str(value)
func test():
print("ok")
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.1 Page: 244ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API