我需要将以下内容作为Unity编辑器中添加的新C#脚本的默认模板.
I need to make the following as the default template of my new C# scripts added in Unity Editor.
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace ProjectName { public class ScriptName: MonoBehaviour { /// <summary> /// /// </summary> #region Fields #endregion #region MonoBehaviour Messages void Start() { } void Update() { } #endregion #region Methods #endregion } }ProjectName是所有脚本的常量,而ScriptName是在脚本资产创建时定义的.
The ProjectName is a constant for all scripts, while ScriptName is defined on script asset creation.
我尝试使用UnityEditor文档,并检查了以下问题" Unity将默认命名空间添加到脚本模板?",但无法实现上述模板
I tried using UnityEditor documentation and checked this question "Unity Add Default Namespace to Script Template?" but couldn't implement the above template
推荐答案我检查了一下,但是没有问题.
I checked that but there's no problem.
检查此点
项目中Assets/Editor中的AddNameSpace类是吗?
Is AddNameSpace class in the Assets/Editor in project?
如果您开发CS,请在Unity \ Editor \ Data \ Resources \ ScriptTemplates
If you develop CS, modify 81-C# Script-NewBehaviourScript.cs in Unity\Editor\Data\Resources\ScriptTemplates
更多推荐
使用自定义模板创建脚本
发布评论