Search Unity

WebGLTemplates folder in Packages

Discussion in 'Package Manager' started by De-Panther, May 15, 2019.

  1. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    287
    Hi,

    Unity WebGL has a feature of web page template, and you use it by placing the files under a folder in Assets/WebGLTemplates
    https://docs.unity3d.com/Manual/webgl-templates.html

    I would like to place a template in a package that I'm working on.
    The current solution is similar to TextMeshPro with the unitypackage that comes with the package and can be unpacked from a menu.
    But are there other ideas for people here?
    Or is it possible to make the Editor check for WebGLTemplates in the Packages folder?

    Thanks
     
    onMouseUp likes this.
  2. mathieur

    mathieur

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    29
    Hello! You can always add your template as a package sample. This would allow users to add the template from the package manager UI's Import Sample action. Here is an example of what it looks like from the package manager UI: Screen Shot 2019-05-15 at 2.17.53 PM.png

    I have also attached an example package that you can inspect to see how to go about doing this.
     

    Attached Files:

  3. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    287
    Thanks, I already tried it.
    The issue with Import Sample, is that it makes a copy in sub-sub-folder with the package name and version. The WebGLTemplates folder must be under Assets folder, and can't be under sub-folders
     
  4. mathieur

    mathieur

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    29
    Ah! I see. Indeed, I can confirm that the WebGLTemplates folder name is hard-coded to check under assets, and there currently isn't a way to extend or modify the import sample action. So your are currently left with the proposed solution of adding your import mechanism in a special menu. I have added a task to see if we can fix both these issues.
     
    De-Panther likes this.
  5. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    287
  6. bsawyer

    bsawyer

    Joined:
    May 6, 2014
    Posts:
    27
    I'm in the same boat as @De-Panther. Any update on this - either from Unity or a clever workaround by OP?

    Thanks.