Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters for generation #4

Open
slimshader opened this issue Apr 22, 2020 · 7 comments
Open

Parameters for generation #4

slimshader opened this issue Apr 22, 2020 · 7 comments

Comments

@slimshader
Copy link

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?
@deniszykov
Copy link
Owner

deniszykov commented Apr 24, 2020

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.

@slimshader
Copy link
Author

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?

@deniszykov
Copy link
Owner

deniszykov commented Apr 24, 2020

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
Copy link
Owner

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.

@slimshader
Copy link
Author

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

@deniszykov
Copy link
Owner

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

@slimshader
Copy link
Author

oh, I missed that, that is great, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants