Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

kyaulabs/unity-scripttemplates

Unity - ScriptTemplates

https://kyaulabs.com/

Contributor Covenant Conventional Commits GitHub Gitleaks
Semantic Versioning Discord

Disclaimer

About

The Unity Editor uses ScriptTemplates as the templates for new file creation, all of these can be accessed by right-clicking in the Project window and selecting Create.

Usage

To utilize these templates over the defaults locate the following.

Location: %ProgramFiles%\Unity\Hub\Editor20円xx.x.xxfx\Editor\Data\Resources\ScriptTemplates\

cd %ProgramFiles%\Unity\Hub\Editor2円0xx.x.xxfx\Editor\Data\Resources
rm -rf ScriptTemplates
git clone https://github.com/kyaulabs/unity-scripttemplates ScriptTemplates

Format

All templates follow the same naming syntax:

81-C# Script__Enum-NewEnum.cs.txt
81 C# Scripts Enum NewEnum .cs
Menu Position Menu Name Menu Item Default filename File extension

Variables

There are a couple of variables that you are allowed to use inside of script templates.

  • #SCRIPTNAME#: will be replaced with the name of the script
  • #NOTRIM#: will make it so the white-space of the current line is not trimmed
  • #ROOTNAMESPACEBEGIN# and #ROOTNAMESPACEEND#: will wrap something with the default namespace

Attribution

Sponsor this project

AltStyle によって変換されたページ (->オリジナル) /