https://github.com/kyaulabs/unity-scripttemplates
Unity script templates used by @kyaulabs.
https://github.com/kyaulabs/unity-scripttemplates
script-templates scripttemplates templates unity unity-script-templates
Last synced: 4 months ago
JSON representation
Unity script templates used by @kyaulabs.
- Host: GitHub
- URL: https://github.com/kyaulabs/unity-scripttemplates
- Owner: kyaulabs
- License: agpl-3.0
- Created: 2023-05-20T08:25:21.000Z (about 2 years ago)
- Default Branch: develop
- Last Pushed: 2023-05-21T18:43:34.000Z (about 2 years ago)
- Last Synced: 2024-12-29T08:13:12.675Z (6 months ago)
- Topics: script-templates, scripttemplates, templates, unity, unity-script-templates
- Language: JavaScript
- Homepage: https://kyaulabs.com
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
#
Unity - ScriptTemplates
[https://kyaulabs.com/](https://kyaulabs.com/)[](CODE_OF_CONDUCT.md) [](https://www.conventionalcommits.org/en/v1.0.0/) [](LICENSE) [](https://github.com/zricethezav/gitleaks)
[](https://semver.org) [](https://discord.gg/DSvUNYm)# Disclaimer
* [About](#about)
* [Usage](#usage)
* [Format](#format)
* [Variables](#variables)
* [Attribution](#attribution)# 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\Editor\20xx.x.xxfx\Editor\Data\Resources\ScriptTemplates`\
```bash
cd %ProgramFiles%\Unity\Hub\Editor\20xx.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