t4-templates-unity3d icon indicating copy to clipboard operation
t4-templates-unity3d copied to clipboard

Parameters for generation

Open slimshader opened this issue 5 years ago • 7 comments

Hi, when using UnityTemplateGenerator. RunForTemplate(templatePath):

  1. is there a way to pass additional parameters to the template when generating? (Possibly via Host property)
  2. is there a way to specify output path so that the same .tt file can be used to generate multiple output files?

slimshader avatar Apr 22 '20 22:04 slimshader

Hi @slimshader . Currently there is no option to provide parameters or to specify output path for generator. I could add it for you. In a few days I will release new version.

deniszykov avatar Apr 24 '20 16:04 deniszykov

That would be great, thanks! Question tho: the matter of license is not really clear to me, I only by coincidence discovered that the same asset is also on the Asset Store but here it says it only need the link and some kind of warning?

slimshader avatar Apr 24 '20 16:04 slimshader

Oh, Unity broke it's own references to Asset Store. Fixed.

License is standard Unity Asset Store License. Short version - pay 10$, use at any number of projects, any number of games for your organization.

Warning in license section says - If you want to make you own asset for Unity Asset Store which is using my t4-templates, at least provide a link to my t4-templates.

deniszykov avatar Apr 24 '20 16:04 deniszykov

Added parameters passing to template in version 2.0.0. You could download and update DLL or wait for Unity Asset update.

Here is example of template with parameters and code to run it.

deniszykov avatar Apr 28 '20 16:04 deniszykov

looking great, thanks! is there a way to pass output file name also? i know that it is not strictly to T4 convention but it would be very useful when running same template for multiple input sets. Using a hack at the moment that writes a file from within a template

slimshader avatar May 09 '20 14:05 slimshader

There is multiple optional parameters in RunForTemplate now. I have added outputPath too.

deniszykov avatar May 15 '20 09:05 deniszykov

oh, I missed that, that is great, thanks

slimshader avatar May 15 '20 09:05 slimshader