-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make onready variables created from dropping nodes include custom types #79198
Conversation
Personally, I prefer the option @onready var name: Type = $Path because the following option @onready var name := $Path as Type hides an error if the node has the wrong type. The object will be silently cast to |
@dalexeev One one hand, that makes me think that the I'll switch the syntax based on the pull release based on the feedback. |
d960dc2
to
3912eec
Compare
3912eec
to
6a1d950
Compare
22c9784
to
cb51826
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last style fix needed, otherwise seems fine.
cb51826
to
57892ba
Compare
57892ba
to
bb2282d
Compare
bb2282d
to
93d5200
Compare
93d5200
to
a51116c
Compare
Thanks! |
This pull request makes dropping a node into the script editor while holding Ctrl generate code of the form
"@onready var name := $Path as Custom""@onready var name:Custom = $Path"Closes godotengine/godot-proposals#7239