|
@@ -35,10 +35,12 @@ Here is a complete class example based on these guidelines:
|
|
|
|
|
|
signal state_changed(previous, new)
|
|
signal state_changed(previous, new)
|
|
|
|
|
|
- export var initial_state = NodePath()
|
|
|
|
- var is_active = true setget set_is_active
|
|
|
|
|
|
+ @export var initial_state: Node
|
|
|
|
+ var is_active = true:
|
|
|
|
+ set = set_is_active
|
|
|
|
|
|
- @onready var _state = get_node(initial_state) setget set_state
|
|
|
|
|
|
+ @onready var _state = initial_state:
|
|
|
|
+ get = set_state
|
|
@onready var _state_name = _state.name
|
|
@onready var _state_name = _state.name
|
|
|
|
|
|
|
|
|
|
@@ -777,11 +779,13 @@ variables, in that order.
|
|
|
|
|
|
const MAX_LIVES = 3
|
|
const MAX_LIVES = 3
|
|
|
|
|
|
- export(Jobs) var job = Jobs.KNIGHT
|
|
|
|
- export var max_health = 50
|
|
|
|
- export var attack = 5
|
|
|
|
|
|
+ @export var job: Jobs = Jobs.KNIGHT
|
|
|
|
+ @export var max_health = 50
|
|
|
|
+ @export var attack = 5
|
|
|
|
|
|
- var health = max_health setget set_health
|
|
|
|
|
|
+ var health = max_health:
|
|
|
|
+ set(new_health):
|
|
|
|
+ health = new_health
|
|
|
|
|
|
var _speed = 300.0
|
|
var _speed = 300.0
|
|
|
|
|