unity自定义script模板

以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 () {
        //}
    }
}

 

posted on 2017-08-21 19:53  dongzee  阅读(459)  评论(0编辑  收藏  举报