So, this is in-progress but the way it's shaping up is pretty cool. Basically, I went with an easier-to-use abstract class inheritance system, so your actual keyword definition class will look something like this:
C#:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnfinityGames.uTemplate;
public class uTemplateKeywords : uTemplateCustomKeywordContainer
{
public string HeaderInfo = "//Copyright (c) Some Company 2017. All rights reserved.\n"
+ "//#NICESCRIPTNAME# (#SCRIPTNAME#) generated on #DATETIME#.";
public override Dictionary<string, string> KeywordReplacements()
{
return new Dictionary<string, string>()
{
{ "#DATE#", System.DateTime.Now.ToString("MM/dd/yyyy") },
{ "#DATETIME#", System.DateTime.Now.ToString("MM/dd/yyyy HH:mm") },
{ "#HEADERINFO#", HeaderInfo }
};
}
}
As you can see, you can get pretty creative with the keyword replacements, and there aren't really any restrictions on what you can use as a replacement value (as long as it evaluates to a string!).
The best news is that these are evaluated at generation time (i.e. when the script is being generated by uTemplate) so DateTime will work correctly. One important thing, though, is that these replacements operate independently of some of the built-in ones. Due to the way these get injected, they get injected
after some built-in ones are processed. The good news is that it makes these much more flexible (so flexible that SCRIPTNAME and NICESCRIPTNAME are now using this system internally!). The main thing is that you can't use SCRIPTHEADER or SCRIPTMETHODS with these, as those have to be on their own lines for proper processing.
Otherwise, if a keyword doesn't require it being on its own line (like SCRIPTNAME, for example, or any custom ones) you can nest these and have keywords inside of keyword replacements, like HeaderInfo in the above example.
This is a pretty big change, and it's not fully functional yet, but if you want to PM my your invoice number here I can get you set up with a beta version of this new feature when it's ready.