heart_plugin.gd 395 B

12345678910111213
  1. @tool
  2. extends EditorPlugin
  3. func _enter_tree() -> void:
  4. # When this plugin node enters tree, add the custom type.
  5. var icon: Texture2D = preload("res://addons/custom_node/heart.png")
  6. add_custom_type("Heart", "Node2D", preload("res://addons/custom_node/heart.gd"), icon)
  7. func _exit_tree() -> void:
  8. # When the plugin node exits the tree, remove the custom type.
  9. remove_custom_type("Heart")