我们一般新建的unity脚本默认是这样的:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
我个人觉得不是很习惯,每次有可能用不上这些函数,这样会造成每次都要手动去删除。那么怎么修改呢,往下看:
1.打开unity的安装目录
2.找到Data\Resources\ScriptTemplates,打开ScriptTemplates文件夹
3.打开第一个文件,我们就能看到这样的一个脚本模板。