44 lines
766 B
C#
44 lines
766 B
C#
#if TOOLS
|
|
using Godot;
|
|
|
|
[Tool]
|
|
public partial class PvZAdventure : EditorPlugin
|
|
{
|
|
private PackedScene panel = ResourceLoader.Load<PackedScene>("uid://dkq82o31vr3i2");
|
|
|
|
private Control panelInstance;
|
|
public override void _EnterTree()
|
|
{
|
|
panelInstance = panel.Instantiate<Control>();
|
|
EditorInterface.Singleton.GetEditorMainScreen().AddChild(panelInstance);
|
|
_MakeVisible(false);
|
|
|
|
}
|
|
public override void _ExitTree()
|
|
{
|
|
if (panelInstance != null)
|
|
{
|
|
panelInstance.QueueFree();
|
|
}
|
|
}
|
|
|
|
|
|
public override bool _HasMainScreen()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public override void _MakeVisible(bool visible)
|
|
{
|
|
if (panelInstance != null)
|
|
{
|
|
panelInstance.Visible = visible;
|
|
}
|
|
}
|
|
|
|
public override string _GetPluginName()
|
|
{
|
|
return "Adventure";
|
|
}
|
|
}
|
|
#endif
|