tool
extends EditorPlugin

var yarn_spinner_importer

func _enter_tree():
	yarn_spinner_importer = preload("yarn_spinner_importer.gd").new()
	add_custom_type("YarnScript", "Resource", preload("yarn_script.gd"), preload("icon.png"))
	add_custom_type("YarnRunner", "Node", preload("yarn_runner.gd"), preload("icon.png"))
	add_import_plugin(yarn_spinner_importer)

func _exit_tree():
	remove_custom_type("YarnScript")
	remove_custom_type("YarnRunner")
	remove_import_plugin(yarn_spinner_importer)
	yarn_spinner_importer = null
