Script Template Manager

Hello Everyone,

I’m starting this thread to annonce and support the unity editor extension, called Script Template Manager, I worked on.

What is it ?

Script Tempalte Manager is an extension package of the Unity Editor that allows the creation and management of custom script templates (not only c# script but any text based asset).

  • Key features

  • Create/Edit/Delete text based asset templates

  • Share template definition between project and teams

  • Define custom placeholder for each template to fillin at the asset creation

  • Built in placeholders for systems variavles like project name or company name (usefull for namespace definition)

Why bother ?
Watching lots of youtube tutorial on Unity brought to attention that whatever the code editor used, unity user allmost always create new script in the unity editor and end up removing most of the generated code that they don’t need. The built in script templates can be modifeid by tempering the unity editor installtion files but some user may not be confortable doing so. In addition with the rasie of the nexw DOTS framework, user will have more and more kinds of scripts to handle (RuntimeComponens,AuthoringComponents,Systems,Jobs,UI Element scripts,…). So Script Template Manager aims at offering a more user friendly and more flexible alternative to create and manage text based asset tempaltes from the editor.

You can find out more on Git Hub.

Hope you enjoy and look forward to your feed back either on the forum thread or the git issues.

1 Like

Cool concept but doesn’t seem to work for me.

It has not been updated for some time now.
Can you tell me what issue you have ?
In addition, mayed take a look at ProjectWindowUtil.CreateScriptAssetFromTemplateFile.
It should be a much better replacement for what this package was doing.

Partial exemple from my skill system :

    internal class ScriptTemplates
    {

        public const string TemplatesRoot = "Packages/wayn-group.mgm.skill/Editor/ScriptTemplates";

        [MenuItem("Assets/Create/MGM/Effect Type")]
        public static void CreateRuntimeComponentType()
        {
            ProjectWindowUtil.CreateScriptAssetFromTemplateFile(
                $"{TemplatesRoot}/EffectType.txt",
                "NewEffect.cs");
        }
    }
namespace NAMESAPCE
{
    public struct #SCRIPTNAME# : IEffect
    {
        // YOUR CODE : delcare all necesasry data inherant to the effect consumption, could be a the effect power, damage type,...

        #NOTRIM#

        // Mandatory for Authoring, do not edit
        public void Convert(Entity entity, EntityManager dstManager, int skillIndex)
        {
            EffectUtility.AddEffect<#SCRIPTNAME#Buffer, #SCRIPTNAME#>(entity, dstManager, skillIndex, this);
        }
    }
}
1 Like