Search Issue Tracker
Won't Fix
Votes
15
Found in
4.3.1f1
Issue ID
583240
Regression
No
Add T4 templates to user script projects
While editing scripts in MonoDevelop, user has created text templating "T4 Template" file, which was successfully added in file hierarchy in MonoDevelop. Then user switched to Unity editor and switched back to MonoDevelop. Project's solution is always updated with T4 Template files being removed from hierarchy in MonoDevelop.
Reproduced on all versions from 4.2.2f1 to 4.5.0a4;
Repro steps:
1. Create new project in Unity editor;
2. Create new C# script;
3. Open this new file from editor with MonoDevelop;
4. In MonoDevelop create T4 Template file (File -> New -> File -> Text Templating -> T4 template). Name file and tick the box below to add this file to project's "Assets" folder;
5. Observe that T4 template file appears in the solution;
6. Switch to Unity editor, wait while editor finishes script compiling, switch back to MonoDevelop, wait while it refreshes the solution.
7. Observe that T4 Template file has gone from solution hierarchy.
------------
Create T4 templates using the existing MonoDevelop add-in for this once the Monodevelop/Rest Integration is shipped. Also, Unity does not have direct support for handling T4 templates.
To use T4 templates, please use Xamarin Studio or Visual studio in a separate solution (.sln)
Comments (25)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Scrollbar briefly appears in the Package Manager during installation process even when the package list is too short to require scrolling
- Script resets to use the previous Skybox color when saving the Scene changes
- [2D] Sprite Library Editor window throws NullReferenceException error when entering Play Mode with Game View maximised
- Game View Tab Scale changes erratically when a Unity Tab is on a different screen with a differing Display Scale
- Six way lighting receiving wrong lighting from APV when set to World Space
BenBond
Jan 15, 2020 05:44
Tracker of the issue and factor is moved for the built consumption for the reign. The tracking system and visitors of the https://www.researchwritingkings.com/review-of-writemyessays-net/ are built for the approval of the charges. The turn is manner oriented or the tools of the field. its impact is run for all laws. the norm is built for the ray in the mid of the parked and suggested elements for the systems.
unity_pa44BdWKm7Ga0A
Oct 17, 2019 21:54
@LAZER_13 this doesn't really work. The only thing what will happen now is that tt files show up in the csharp project. But no tool will be related and when you relate the text transform tool a new file will be generated instead of the existing file being overwritten.
I updated the orignal solution of @BDEV and this works fine for me:
https://github.com/njannink/T4ForUnity
Lazer_13
Oct 16, 2018 20:55
In Unity 5 there is now an option to include tt (or any other) extensions into the C# VS build. Not sure exactly how far back this goes or when it was introduced.
Can be found under Edit -> Project Setting -> Editor -> C# Project Generation
bdev
Dec 21, 2015 13:04
I made this code to implement this.
http://pastebin.com/vmGQJeLk
Should compile that to a dll and place it in a editor folder. Then whenever unity makes the sln it automatically incorporates .tt files if there is a matching generated file with a different extension (which is pretty much given).
But it would be good to see unity sliver that code into the editor officially. (T4 is great!)
lukaszunity
Sep 18, 2015 06:42
Use Xamarin Studio or Visual Studio with a separate solution (.sln) to create T4 templates.