Basic Setup
By default 4 keywords are created : DATE, DEVELOPER_NAME, NAMESPACE, RELATIVE_NAMESPACE. They are on the ScriptTemplateSettings asset file.
Configure the keyword DEVELOPER_NAME by selecting it and filling the Value field :
Note : DEVELOPER_NAME is a keyword with personnal value. The value is stored only on your computer.
Configure the keyword RELATIVE_NAMESPACE by selecting it and filling the Namespace field :
RELATIVE_NAMESPACE is a keyword computing the relative namespace using namespace plus a combinaison of folder where the script is placed. Some filters allow to ignore specials folders. More Informations
Edit the Unity basic template by selecting ScriptTemplateSettings and clicking on "Edit Script Template" button :
Open 81-C# Script-NewBehaviourScript.cs.txt
And copy paste the template below : (or setup your own template style)
///-----------------------------------------------------------------
/// Author : #DEVELOPER_NAME#
/// Date : #DATE#
///-----------------------------------------------------------------
using UnityEngine;
namespace #RELATIVE_NAMESPACE# {
public class #SCRIPTNAME# : MonoBehaviour {
private void Start () {
#NOTRIM#
}
private void Update () {
#NOTRIM#
}
}
}
Save and close the template.
All the keywords will be replaced by the values.
DATE is a keyword with a computed value. You can edit the date format by selecting DATE keyword and updating the field Date Format.
Now, it's time to check if the setup is correct :
Create a script and open it.
You should get the result at the right (with your datas) :
Note : There is an enabled option on ScriptTemplateSettings to update automatically namespace when you move a script and another option to update automatically type when you rename a script.
Be careful ! That does not update all the other scripts referencing it.