Oct
7
2016

Adding Custom Script Templates

custom-editor-script-template

Adding custom script templates is quite simple:
– Create your custom script
– Replace all class name strings with #SCRIPTNAME# (this will get replaced by the new created script name)
– Move the script file under your unity installation folder: \Unity\Editor\Data\Resources\ScriptTemplates\
– Rename “YourScript.cs” into “81a-C# Your Script-YourNewScript.cs.txt” (’81a’ is the menu location, so this would appear below the default c# script)

Note:
– This folder gets replaced if you install new Unity version!
– You need to restart unity after you have placed the file on that folder (otherwise its not visible in the menu)
– You can remove the “82-Javascript-NewBehaviourScript.js.txt” if you don’t need javascript files, saves some space on the menu..

Example editor script template:
https://github.com/UnityCommunity/UnityLibrary/blob/master/ScriptTemplates/81a-C%23%20Editor%20Script-NewEditorScript.cs.txt

 

References:
https://support.unity3d.com/hc/en-us/articles/210223733-How-to-customize-Unity-script-templates


1 Comment + Add Comment

Leave a comment

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.