以mac为例,在/Applications/Unity/Unity.app/Contents/Resources/ScriptTemplates/
新建1个模板文件:91-C# YourNameSpaceScript-NewBehaviourScript.cs.txt
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace YourNameSpace { public class #SCRIPTNAME# : MonoBehaviour { // Use this for initialization private void Awake() { #NOTRIM# } // Use this for initialization private void Start () { #NOTRIM# } // Use this for termination private void OnDestroy() { #NOTRIM# } // Update is called once per frame //private void Update () { //} } }