-
Notifications
You must be signed in to change notification settings - Fork 11
/
plugin.gd
33 lines (22 loc) · 868 Bytes
/
plugin.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@tool
extends EditorPlugin
var _added_types: Array
var _added_singletons: Array
var _editor_interface := get_editor_interface()
var _editor_settings := _editor_interface.get_editor_settings()
func _ready() -> void:
pass
func _enter_tree() -> void:
add_autoload_singleton("FrayInputMap", "res://addons/fray/src/input/autoloads/fray_input_map.gd")
add_autoload_singleton("FrayInput", "res://addons/fray/src/input/autoloads/fray_input.gd")
func _exit_tree():
for singleton in _added_singletons:
remove_autoload_singleton(singleton)
for type in _added_types:
remove_custom_type(type)
func add_autoload_singleton(name: String, path: String) -> void:
super(name, path)
_added_singletons.append(name)
func add_custom_type(type: String, base: String, script: Script, icon: Texture2D) -> void:
super(type, base, script, icon)
_added_types.append(type)