Tool to generate and update node and class references for GDScripts.
Copy the reference_generator
folder into the addons folder, or use my plugin manager:
gopm install https://github.com/Jummit/referencer-addon.git
To generate node references, select the nodes you want to reference and execute the tool option under Editor > Tools > Generate Node References
. This will copy the references to the clipboard, which you can then paste in your script.
Example:
onready var _referenced_node: Sprite = $Path/To/Node
To update the references if you moved or renamed a node, you can copy the references in your script and execute the Update Node References
option. You can then update the references inside your script with the clipboard.
Class references can be generated by opening the class in the script editor and executing the Generate Class Reference
option. You can then paste the reference inside your script.
Example:
const ReferencedClass = preload("res://path/to/script.gd")