Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Does the 'Resources' API Still Exist In WebGL?

Discussion in 'Web' started by brendan-vance, Jun 23, 2015.

  1. brendan-vance

    brendan-vance

    Joined:
    Jan 16, 2014
    Posts:
    36
    I've spent the day attempting to update my studio's iOS/Android/WebPlayer project to build into WebGL, and uh... it appears that Unity's WebGL build process is nulling references to various assets located in Resources throughout my scenes?)

    ...And that Resources.LoadAll does not work on OpenGL, but this is "by design"? http://issuetracker.unity3d.com/issues/resources-dot-loadall-not-working-in-the-webgl

    ...And that the entire Resources API may soon be flagged obsolete? http://forum.unity3d.com/threads/list-with-obsolete-api.276379/

    I haven't been able to find much about any of this on google, only these little pieces. So like... are y'all gamedevs using the Resources API as usual (Resources.Load, Resources.LoadAll, etc) in your webgl stuff, and is it working as usual? Am I just doing something stupid somewhere in this project? What am I missing here?
     
    Last edited: Jun 24, 2015
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Resources.Load and Resources.LoadAll should still work as expected and there are no plans to deprecate them, at least in the short term. If you encounter any problem I would suggest that you submit a bug report.
     
    twobob likes this.
  3. brendan-vance

    brendan-vance

    Joined:
    Jan 16, 2014
    Posts:
    36
    It looks like the problem had to do with loading two levels immediately after one another; waiting for one frame in between loads appears to resolve it. As this issue only occurs in WebGL, I expect this is a bug; I'll see if I can get a test case together.
     
  4. brendan-vance

    brendan-vance

    Joined:
    Jan 16, 2014
    Posts:
    36
    Test case produced, bug reported! It's case 707488.
     
  5. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Thank you for the bug report, we will take a look.
     
    twobob likes this.