One of the most common things we create in the Unity editor is new scripts. When you click the Create menu on the Project pane, or right-click in the Project pane of the editor, you get get a list of assets that Unity can create and the scripts that Unity supports by default are here.
Frankly, Unity's default selection of scripts and the quality is a bit lacking. Most people don't realize you can modify the scripts, or even add your own.
The scripts are stored in a directory called ScriptTemplates.
On Mac:
1. Find your Unity app and right-click, then choose Show Package Contents.
2. From there you can find the ScriptTemplates folder at Contents/Resources/ScriptTemplates
On Windows:
1. Find your Unity installation.
2. From there you can find the folder in the sub-directory Editor\Data\Resources\ScriptTemplates (default is C:\Program Files\Unity\Editor\Data\Resources\ScriptTemplates)
Once you got the directory, you'll see a list of files with funny names. For example:
81-C# Script-NewBehaviourScript.cs.txt
The filename is broken into parts, separated by the "-" character.
The "81" means the script is in the "80"s group and will appear below "Folder" and above "Prefab". They are sorted by number. If two scripts have the same number, then they're sorted alphabetically after that. So if you want to have a few Javascript templates, you can give them all "80" prefix, and then all your C# scripts "81" prefix, and so on.
The next part is the name that will appear in the menu, e.g. "C# Script". Use something descriptive so you know what it is. You can even create scripts for projects, so it could be something like "C# Enemy Template", etc.
The part after that "NewBehaviorScript" is what will be the default name when it's added to your project. This part doesn't really matter because when you create a new file, Unity will select it for editing automatically. This is important and will be discussed below.
After that is the extension that the file will use, and it ends with a ".txt" as this file is a text asset at this point.
Inside the files you create, there is currently a single supported tag that Unity will replace on create for you. The tag is "#SCRIPTNAME#". Anywhere in your template that the word #SCRIPTNAME# appears, Unity will replace it with whatever you named your file. Neat!
After you add, remove or change a script, restart the Unity editor. You can simply reopen the currently opened project, there's no need to quit Unity completely.
To get you started, I have attached a zip containing the scripts I have on my system. Unzip these to a local folder and have a look and try them out.
Enjoy!
Cheers,
Brett
плюс что то там в аттачментах