Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

What's up with EntityComponentSystemSamples/Hacking.md?

Discussion in 'Entity Component System' started by DreamingImLatios, Apr 9, 2019.

  1. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,984
    Is this a file we are supposed to see, or is this supposed to be internal to Unity? If we are supposed to see it, is there a place where the T4 patch tool is publicly available?

    I'm honestly curious as I just started experimenting with T4 for the first time and found it is a good solution for when I want a job that can work with a variable number of NativeContainers determined at runtime on load. The way I got it set up was hacky and I am wondering if Unity will have an official workflow or if I should spend time trying out other options around GitHub and the Asset Store?
     
  2. scobi

    scobi

    Unity Technologies

    Joined:
    May 14, 2014
    Posts:
    32
    Yeah it's meant to be internal, as it is referring to the .tt files we maintain inside some of the packages (like for example Entities) and not anything in the EntityComponentSystemSamples repo. Still, it is generally useful info on "how to T4 with Unity". I'll see if I can find a better place for it.

    Re where the T4 tool is publicly available: in HACKING.md look for "Wait, how do I get a T4 processor??"

    Re a workflow for Unity, that's what this file is trying to establish. Unity generates csproj's that don't include anything about .tt files, so I wrote a little powershell script to do the fixup. It's not available in this repo but I attached it to this post (just remove the `.txt` extension). I have a package I'm working on that will eventually make this built-in to Unity. Also, using VSCode is a low-rent and fairly ok way to edit T4 files, and is typically how I do it. Instructions are in the soon-to-be-moved HACKING.md file.

    Btw you can see what we're doing with T4 by going into the Unity.Entities package and looking at the .tt files and the .gen.cs files that they generate. (They're getting kind of out of control in size, too. I really need to break them down further.)
     

    Attached Files:

  3. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    122
    Hi,

    A few questions about that package you are working on:
    - Will it be available for us ?
    - Will it allow T4 templates without anything else to do and with full features ?
    - Do you have a rough ETA ? Like if you were to say something would it be under 3 months, between 3-6 months or more ?

    It's not like I want it now, it's only for estimation purposes, I just want to know if what I'm working on could wait or not for that package.

    Thanks!
     
  4. scobi

    scobi

    Unity Technologies

    Joined:
    May 14, 2014
    Posts:
    32
    It will be open and available to everyone via the package manager interface. Don't know timeline for that yet, though - I want to get it successfully in use for at least a few major projects internally before we start promoting it outside. Probably won't be in 2019.

    My plan for T4 support is to be "it just works" fully featured through Unity and CLI.
     
    dzamani and FROS7 like this.
  5. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    122
    Perfect, I have a setup that is bruteforcing my .csproj to handle template files so I can keep that for at least 2019.
    The main point is to not run your powershell fix by hand and just fix the .csproj automatically (still have one edge case where it doesn't get triggered but I'm working on it).

    Anyway, thanks for the fast answer and good luck with that package!