标签:eal mod static ace odi unity res log script
在Editor目录下创建文件 ScriptCreatInit.cs,内容如下:
//===================================================
//作 者:zhouzelong
//博 客:http://zhouzelong.cnblogs.com
//创建时间:2020-06-04 00:19:08
//备 注:创建脚本时,自动生成代码注释
//===================================================
using System.IO;
using System;
using UnityEditor;
public class ScriptCreatInit : UnityEditor.AssetModificationProcessor
{
private static void OnWillCreateAsset(string path)
{
path = path.Replace(".meta","");
if (path.EndsWith(".cs"))
{
string strContent = "//===================================================\r\n" +
"//作 者:zhouzelong\r\n" +
"//博 客:http://zhouzelong.cnblogs.com\r\n" +
"//创建时间:#CreateTime#\r\n" +
"//备 注:\r\n" +
"//===================================================\r\n";
strContent += File.ReadAllText(path);
strContent = strContent.Replace("#CreateTime#", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
File.WriteAllText(path, strContent);
AssetDatabase.Refresh();
}
}
}
标签:eal mod static ace odi unity res log script
原文地址:https://www.cnblogs.com/zhouzelong/p/13041077.html