Basics
This commit is contained in:
parent
c8956dc38b
commit
0e9e17cfdc
20 changed files with 267 additions and 1 deletions
44
addons/pvzadventure/PvZAdventure.cs
Normal file
44
addons/pvzadventure/PvZAdventure.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#if TOOLS
|
||||
using Godot;
|
||||
|
||||
[Tool]
|
||||
public partial class PvZAdventure : EditorPlugin
|
||||
{
|
||||
private PackedScene panel = ResourceLoader.Load<PackedScene>("res://addons/pvzadventure/scenes/adventure_editor.tscn");
|
||||
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue