-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlugin.cs
28 lines (24 loc) · 870 Bytes
/
Plugin.cs
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
#if TOOLS
using Godot;
[Tool]
public partial class Plugin : EditorPlugin
{
const string CONTAINER_SCRIPT_PATH = "res://addons/vekDevConsole/scripts/DevConsoleContainer.cs";
const string CONTAINER_ICON_PATH = "res://addons/vekDevConsole/consoleIcon.svg";
const string SINGLETON_PATH = "res://addons/vekDevConsole/scripts/DevConsole.cs";
public override void _EnterTree()
{
// Initialization of the plugin goes here.
Script devConsoleScript = GD.Load<Script>(CONTAINER_SCRIPT_PATH);
Texture2D devConsoleIcon = GD.Load<Texture2D>(CONTAINER_ICON_PATH);
AddCustomType("DevConsole", "Control", devConsoleScript, devConsoleIcon);
AddAutoloadSingleton("DevConsole", SINGLETON_PATH);
}
public override void _ExitTree()
{
// Clean-up of the plugin goes here.
RemoveCustomType("DevConsoleContainer");
RemoveAutoloadSingleton("DevConsole");
}
}
#endif