You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `#[property]` attribute can accept a several options to refine the export behavior.
25
+
26
+
You can specify default property value with the following argument:
27
+
28
+
```rust
29
+
#[property(default = 10)]
30
+
enemy_count:i32,
31
+
```
32
+
33
+
If you need to hide this property in Godot editor, use `no_editor` option:
34
+
35
+
```rust
36
+
#[property(no_editor)]
37
+
enemy_count:i32,
38
+
```
39
+
40
+
## Property access hooks
41
+
42
+
You can add hooks to call methods before and after property value was retrieved or changed.
43
+
44
+
Note that unlike [GDScript's `setget` keyword](https://docs.godotengine.org/en/3.3/getting_started/scripting/gdscript/gdscript_basics.html?#setters-getters), this does _not_ register a custom setter or getter. Instead, it registers a callback which is invoked _before or after_ the set/get occurs, and lacks both parameter and return value.
0 commit comments