Reputation: 51
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
}
}
The ProjectName is a constant for all scripts, while ScriptName is defined on script asset creation.
I tried using UnityEditor documentation and checked this question "Unity Add Default Namespace to Script Template?" but couldn't implement the above template
Upvotes: 4
Views: 332
Reputation: 174
I checked that but there's no problem.
Check This Point
Is AddNameSpace class in the Assets/Editor in project?
If you develop CS, modify 81-C# Script-NewBehaviourScript.cs in Unity\Editor\Data\Resources\ScriptTemplates
Upvotes: 3