[Updated] T4 Templates for Unity editor

This Unity editor extension provides T4 text templates processor. T4 template is a mixture of text blocks and control logic that can generate a text file. The control logic is written as fragments of program code in C#. The generated file can be text of any kind, such as resource file, source code or web page.

[Asset Store Package] [Source Code] [Documentation] [Examples]

Use cases:
• Repeating source code generation
• Project resources catalogization
• Resource loading/reading code generation
• Code generation by DSL
• Code generation for ORM (BLToolkit for example)
• Embedding environment information into project’s build

Price: 10$

Question: if you provide the full source code, why are you charging 10$ for this extension?

Because it’s costs 10$ :slight_smile:
Even if code is open-source, it has licence which defines legal ways to use it. So, only legal way to use this source code in your project is to buy it from Unity Asset Store.

Why I published source code? For user’s feedback, for faster updates (no 2 weeks Asset Store reviews), to facilitate purchasing decisions.

1 Like

Does it work with Unity 2018 in .NET 4.X mode?

Hi slimshader!

  1. Yes it work in .NET 4 mode, at least on Windows.
  2. But It is not allow C# 4 syntax in T4 templates because old complilation API (CodeDom, not Roslyn).

You can always get asset from GitHub and test it before buying. If you find any troubles with it please report here or on GitHub. Support will be provided regardless of asset purchase fact.

1 Like

(Underline is mine.) FYI, that’s not that we call open source. Source-available software may be a better term to describe your business model.

You are right. It is not open-source, by the “Unity Asset License” in first place.

1 Like

@DenisZykov Thanks for this asset - I bought it yesterday to generate some enums dynamically based on config data I’m loading in editor.

The asset files all appear to be stored in a top level /Editor folder rather than a folder named after the asset (which is normal for most assets on the asset store). I wanted to move them to /T4Templates/Editor, but that caused the Generate button to no longer function.

I moved the assets back. Not sure that’s all related, but now I’m getting errors every time I start the project:

Failed to load template's settings: System.NullReferenceException: Object reference not set to an instance of an object
  at GameDevWare.TextTransform.TemplateSettings.Load (System.String templatePath) [0x0001d] in <269bbfe4ea7749ad8ec7178e1d170085>:0
UnityEngine.Debug:LogError(Object)
GameDevWare.TextTransform.TemplateSettings:Load(String)
GameDevWare.TextTransform.AssetChangesTrigger:CreateWatchers()
GameDevWare.TextTransform.AssetChangesTrigger:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)

Any ideas?

cool, but I didn’t get the purpose of this asset. Main problem for me is that .tt files gets removed from unity solution as soon as it compiles which leads to loss of intellisense(I use fortea) features for .tt files. That’s why I use different project for template building .
building template itself in unity or in some other project is same for the most part.

I get this too, I haven’t needed the T4 generation (not touched anything it generates for a while), but I think it did work. However this spams needless errors to the console; would like to get them cleaned up.

So any update?