#region 模块信息
// **********************************************************************
// Copyright (C) 2018 The company name
//
// 文件名(File Name): SpriteTitleChange.cs
// 作者(Author): Circle
// 创建时间(CreateTime): 2018/9/5 10:57:45
// 修改者列表(modifier):
// 模块描述(Module description): 创建脚本自动修改文件名、作者、创建时间
// **********************************************************************
#endregion
using UnityEngine;
using System.Collections;
using System.IO;
public class SpriteTitleChange : UnityEditor.AssetModificationProcessor
{
private static void OnWillCreateAsset(string path)
{
path = path.Replace(".meta", "");
if (path.EndsWith(".cs"))
{
string allText = File.ReadAllText(path);
allText = allText.Replace("#AuthorName#", "Circle")
.Replace("#CreateTime#", System.DateTime.Now.Year + "/" + System.DateTime.Now.Month
+ "/" + System.DateTime.Now.Day + " " + System.DateTime.Now.Hour + ":"
+ System.DateTime.Now.Minute + ":" + System.DateTime.Now.Second);
File.WriteAllText(path, allText);
}
}
}