Pong/addons/CustomTypes/Plugin.cs
Fries 8072cf4961 the enemy can now scale to the resolution.
i made a BasePaddle class so i can put commonly used fields in a base class. this means i made a new plugin called CustomTypes which contains both Base classes.
2023-05-23 21:48:30 -07:00

28 lines
775 B
C#

#if TOOLS
namespace Pong.addons.CustomTypes
{
[Tool]
public partial class Plugin : EditorPlugin
{
public override void _EnterTree()
{
var baseMenuScript = GD.Load<Script>("res://Scripts/Managers/UI/BaseMenu.cs");
var basePaddleScript = GD.Load<Script>("res://Scripts/Managers/BasePaddle.cs");
AddCustomType("BaseMenu", "VBoxContainer", baseMenuScript, GetEditorIcon("VBoxContainer"));
AddCustomType("BasePaddle", "RigidBody2D", basePaddleScript, GetEditorIcon("RigidBody2D"));
}
public override void _ExitTree()
{
RemoveCustomType("BaseMenu");
RemoveCustomType("BasePaddle");
}
private Texture2D GetEditorIcon(string iconName)
{
return GetEditorInterface().GetBaseControl().GetThemeIcon(iconName, "EditorIcons");
}
}
}
#endif