Пример #1
0
    private static void CreateCode(string strAuthor, string mName, string mPath, string mTemplate)
    {
        DateTime dt = DateTime.Now;

        TemplateEngine.TemplateBasePath = "Assets/Editor/UITool/Template/";
        Dictionary <string, string> valueDic = new Dictionary <string, string>();

        valueDic["Author"]     = strAuthor;
        valueDic["CreateDate"] = string.Format("{0}.{1}.{2}", dt.Year, dt.Month, dt.Day);
        valueDic["moduleName"] = mName;

        TemplateEngine.CreateCodeFile(mPath.Replace("${moduleName}", mName), mTemplate, valueDic);
        TemplateEngine.TemplateBasePath = null;
    }