GameDevWare.TextTransform 2.0.0

dotnet add package GameDevWare.TextTransform --version 2.0.0                
NuGet\Install-Package GameDevWare.TextTransform -Version 2.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GameDevWare.TextTransform" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GameDevWare.TextTransform --version 2.0.0                
#r "nuget: GameDevWare.TextTransform, 2.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GameDevWare.TextTransform as a Cake Addin
#addin nuget:?package=GameDevWare.TextTransform&version=2.0.0

// Install GameDevWare.TextTransform as a Cake Tool
#tool nuget:?package=GameDevWare.TextTransform&version=2.0.0                

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:

  • Output Type - type of generated file
    • Content - normal template's output. It corresponds to "Design-time T4 text templates" in Microsoft's terminology.
    • Generator - generator-class which can generate content when TransformText() is called. It corresponds to "Run time T4 text templates" in Microsoft's terminology.
  • Output Path - path to generated file. If not specified, generated file will have file name of template and file extension from output directive.
  • Auto-Gen Triggers - list of events which trigger auto-generation.
    • Code Compilation - after each code compilation
    • Asset Changes - after watched assets are changed, look for Assets to Watch
  • Auto-Gen Delay (Ms) - delay before triggered auto-generation starts
  • Assets to Watch - list of assets and folders which trigger auto-generation

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" #>

MSBuild Macros are not available.

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

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

If you embed this package, you MUST provide a link and warning about embedded package in the description of your package.

Asset Store Terms of Service and EULA

Product Compatible and additional computed target framework versions.
.NET Framework net35 is compatible.  net40 was computed.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 3.5

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 1,338 4/28/2020
1.0.14 538 12/23/2019
1.0.11 720 5/5/2019
1.0.10 674 4/20/2019
1.0.7 3,950 11/13/2017

breaking change: enum value TemplateSettings.OutputTypes.Code renamed to TemplateSettings.OutputTypes.Text
breaking change: enum value TemplateSettings.OutputTypes.CodeGenerator renamed to TemplateSettings.OutputTypes.TextGenerator
breaking change: enum GenerationResult to TransformationResult
add UnityTemplateGenerator.RunForTemplate with additional parameters
add XML documentation to most public members
add parameters passing example