7
2016
Adding Custom Script Templates
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
Related Posts
1 Comment + Add Comment
Leave a comment
Recent posts
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
Recent Comments
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- ffmpeg stream raw video into Unity Texture2D on
Check out my open source project that allows creating custom templates easily: https://bitbucket.org/liortal/code-templates