From 36d4417905892bec73489b7ecd500886dd53b5c2 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 20 Dec 2024 09:29:36 -0600 Subject: [PATCH] Add game plugin template. --- .../Editor/Scripting/GamePluginTemplate.cs | 25 +++++++++++++++++++ Source/Editor/Content/Proxy/CSharpProxy.cs | 17 +++++++++++++ .../Editor/Modules/ContentDatabaseModule.cs | 1 + 3 files changed, 43 insertions(+) create mode 100644 Content/Editor/Scripting/GamePluginTemplate.cs diff --git a/Content/Editor/Scripting/GamePluginTemplate.cs b/Content/Editor/Scripting/GamePluginTemplate.cs new file mode 100644 index 000000000..d110fa68d --- /dev/null +++ b/Content/Editor/Scripting/GamePluginTemplate.cs @@ -0,0 +1,25 @@ +%copyright%using System; +using System.Collections.Generic; +using FlaxEngine; + +namespace %namespace%; + +/// +/// %class% GamePlugin. +/// +public class %class% : GamePlugin +{ + /// + public override void Initialize() + { + base.Initialize(); + + } + + /// + public override void Deinitialize() + { + base.Deinitialize(); + + } +} \ No newline at end of file diff --git a/Source/Editor/Content/Proxy/CSharpProxy.cs b/Source/Editor/Content/Proxy/CSharpProxy.cs index 8abdf8b30..f0a7997c7 100644 --- a/Source/Editor/Content/Proxy/CSharpProxy.cs +++ b/Source/Editor/Content/Proxy/CSharpProxy.cs @@ -106,6 +106,23 @@ namespace FlaxEditor.Content } } + /// + /// Context proxy object for C# GamePlugin files. + /// + /// + [ContentContextMenu("New/C#/C# GamePlugin")] + public class CSharpGamePluginProxy : CSharpProxy + { + /// + public override string Name => "C# GamePlugin"; + + /// + protected override void GetTemplatePath(out string path) + { + path = StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Scripting/GamePluginTemplate.cs"); + } + } + /// /// Context proxy object for empty C# files. /// diff --git a/Source/Editor/Modules/ContentDatabaseModule.cs b/Source/Editor/Modules/ContentDatabaseModule.cs index 7a85107d9..4de7b593b 100644 --- a/Source/Editor/Modules/ContentDatabaseModule.cs +++ b/Source/Editor/Modules/ContentDatabaseModule.cs @@ -1140,6 +1140,7 @@ namespace FlaxEditor.Modules Proxy.Add(new CSharpEmptyStructProxy()); Proxy.Add(new CSharpEmptyInterfaceProxy()); Proxy.Add(new CSharpActorProxy()); + Proxy.Add(new CSharpGamePluginProxy()); Proxy.Add(new CppAssetProxy()); Proxy.Add(new CppStaticClassProxy()); Proxy.Add(new CppScriptProxy());