Search Unity

WebGLTemplates folder and location

Discussion in 'Web' started by De-Panther, Oct 27, 2020.

  1. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    Currently the WebGLTemplates folder must be located in the root Assets folder, unlike the folders of Editor or Plugins.
    It makes it difficult for assets and packages developers to create special templates, as they might get over other packages templates.
    Also, with the Unity Packages Manager, you need to make some hacks in order to copy a template to the project ( example of a hack here https://github.com/De-Panther/unity...3b8915/Packages/webxr/Editor/WebXRMenu.cs#L12 )

    There was this bug report in the past, but it was closed.
    https://issuetracker.unity3d.com/is...from-packages-when-they-are-marked-as-samples
    Is it relevant to re-open it now?
    Should we report about it again?
     
    Marks4 likes this.
  2. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Hmmh, it looks like there are two different ways to approach:

    1. Adding support for placing "WebGLTemplates/" subdirectories to nested subdirs under Assets/. That is, in project build settings, should look for WebGLTemplates/ directories recursively

    and/or

    2. When importing a sample, if the sample contains any "WebGLTemplates/" subdirectories, those should be imported under root WebGLTemplates/ directory, instead of to a nested subdirectory where the rest of the content is imported?

    I presume if either one of these was implemented, it would make the other redundant?

    I think adding support for 1) is probably more flexible, and avoids directory name collision.

    However I wonder whether we'd run into an issue that packages containing templates for, say, 2019.4 format, would not work in Unity 2020.1? (and vice versa) That is, the package will not be universally importable across many Unity versions? So I wonder if we'd also need a way to configure/filter templates to target a specific Unity version (range) only?

    I am leaning towards enabling support for 1), cannot think of a reason why that couldn't be implemented. Would that solve the issue?
     
  3. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    448
    +1 for Option #1.
     
  4. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    Totally option 1.
    It solves all the issues.

    I guess that the current behavior is because that when the feature was new, Unity supported UnityScript (".js" files), and that was the only folder that ignored compilation of ".js" files in the engine. Now that UnityScript is no longer supported, I guess that option 1 would work great.

    Regarding 2019 vs 2020 templates, developers that want to support both versions, can add separate templates for 2019 and 2020.
     
    Marks4 likes this.
  5. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Got it. We'll circulate this request within the team, and proceed from there.
     
    De-Panther likes this.
  6. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
  7. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    247
    Was/is there any news on this? I would love to have option #1
     
  8. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
  9. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    547
    Jukka is still dead? ;_;