Home

Awesome

Introduction

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.

T4 template example:

<html><body>
 The date and time now is: <#= DateTime.Now #>
</body></html>

Use cases

How to use

Create or copy file with .tt extension. Select this file in Project window (Window -> Project), then in Inspector window (Window -> Inspector) setup T4 template's parameters. Click "Generate" button. Inspector window for T4 template contains following parameters:

Details

T4 template can use hostspecific=true property to access Host.ResolvePath method, which maps path relatively to template's location.

By default UnityEngine.dll and UnityEditor.dll assemblies are referenced in all templates. You can reference project's assemblies Assembly-CSharp and Assembly-CSharp-firstpass by adding assembly directive:

<#@ assembly name="Assembly-CSharp" #>
<#@ assembly name="Assembly-CSharp-firstpass" #>

Target Runtime

The template always uses the current runtime and core libraries of Unity Editor.

Language Version

You could specify C# language version with language= directive. List of available language versions:

MSBuild Macros are not available.

You can run template generation from your code with UnityTemplateGenerator.RunForTemplate(templatePath) call.

Version 2.0.0

there is some breaking changes due renaming in this version

Version 1.0.7

fixed missing 's' in project name 'TextTran_S_form', files, namespaces, folders has been renamed. executable name of tools has been changed to 'GameDevWare.TextTransform.exe' new NuGet package will be published

Contacts

Please send any questions at support@gamedevware.com

License

Asset Store Terms of Service and EULA