#FOLDERNAME#のような組み込みテンプレート変数はありません。
this postによれば、3つの魔法の変数しかありません。
- "#名#"
- "#のSCRIPTNAME#"
- "#のSCRIPTNAME_LOWER番号"
しかし、あなたは常に、スクリプトの作成プロセスにフックし、自分で名前空間を追加することができますAssetModificationProcessor
を使用してください。
Hereは、作成したスクリプトにカスタムデータを追加する例です。
//Assets/Editor/KeywordReplace.cs
using UnityEngine;
using UnityEditor;
using System.Collections;
public class KeywordReplace : UnityEditor.AssetModificationProcessor
{
public static void OnWillCreateAsset (string path)
{
path = path.Replace(".meta", "");
int index = path.LastIndexOf(".");
string file = path.Substring(index);
if (file != ".cs" && file != ".js" && file != ".boo") return;
index = Application.dataPath.LastIndexOf("Assets");
path = Application.dataPath.Substring(0, index) + path;
file = System.IO.File.ReadAllText(path);
file = file.Replace("#CREATIONDATE#", System.DateTime.Now + "");
file = file.Replace("#PROJECTNAME#", PlayerSettings.productName);
file = file.Replace("#SMARTDEVELOPERS#", PlayerSettings.companyName);
System.IO.File.WriteAllText(path, file);
AssetDatabase.Refresh();
}
}
2017 Unity C#テンプレートの中には、#NOTRIM#もあります。何のためですか? –