Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Script Template Manager

Discussion in 'Works In Progress - Archive' started by WAYNGames, Sep 28, 2019.

?

Are you interested by such a tool ?

  1. Yes

    2 vote(s)
    100.0%
  2. No

    0 vote(s)
    0.0%
  1. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    974
    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.
     
    Last edited: Sep 28, 2019
    TheVirtualMunk likes this.
  2. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    150
    Cool concept but doesn't seem to work for me.
     
  3. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    974
    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 :
    Code (CSharp):
    1.     internal class ScriptTemplates
    2.     {
    3.  
    4.         public const string TemplatesRoot = "Packages/wayn-group.mgm.skill/Editor/ScriptTemplates";
    5.  
    6.         [MenuItem("Assets/Create/MGM/Effect Type")]
    7.         public static void CreateRuntimeComponentType()
    8.         {
    9.             ProjectWindowUtil.CreateScriptAssetFromTemplateFile(
    10.                 $"{TemplatesRoot}/EffectType.txt",
    11.                 "NewEffect.cs");
    12.         }
    13.     }
    Code (CSharp):
    1. namespace NAMESAPCE
    2. {
    3.     public struct #SCRIPTNAME# : IEffect
    4.     {
    5.         // YOUR CODE : delcare all necesasry data inherant to the effect consumption, could be a the effect power, damage type,...
    6.  
    7.         #NOTRIM#
    8.  
    9.         // Mandatory for Authoring, do not edit
    10.         public void Convert(Entity entity, EntityManager dstManager, int skillIndex)
    11.         {
    12.             EffectUtility.AddEffect<#SCRIPTNAME#Buffer, #SCRIPTNAME#>(entity, dstManager, skillIndex, this);
    13.         }
    14.     }
    15. }
     
    TheVirtualMunk likes this.