Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

How do you use Resources.LoadAsync with a multiple frame sprite?

Discussion in '2D' started by aitchest-of-dees, Nov 3, 2016.

  1. aitchest-of-dees

    aitchest-of-dees

    Joined:
    Dec 28, 2013
    Posts:
    41
    I am trying to load all my sprites asynchronously and it works for single frame sprites, but if the sprite is setup to Sprite Mode: Multiple, only the first frame is loaded. All the answers I've found for loading multiple-frame sprites is to use Resources.LoadAll, which is what I was doing before. As there is no " Resources.LoadAllAsync" command, how do you load multiple frame sprites asynchronously?

    Code (CSharp):
    1.  resourceRequest = Resources.LoadAsync<Sprite>(loadPath);//path to multiple sprite mode sprite
    2. while (!resourceRequest.isDone)
    3. {
    4.      yield return 0;
    5. }
    6. sprite = (Sprite)resourceRequest.asset;//contains frame 0
     
  2. aitchest-of-dees

    aitchest-of-dees

    Joined:
    Dec 28, 2013
    Posts:
    41
    Well I've given up ,and separated all my sprite folders into single frame sprite folders and multi-frame sprite folders, and call a totally different method to load the multi-frame sprites the old way. This is very messy and annoying, since the idea of async loading is to spread out the slowest loading times during the logo screen so they don't make the game choppy or have a long load time between scene changes -- and multi-frame sprites are usually the largest sprite files to load. Unhappy, but moving on.
     
    IgorAherne likes this.
  3. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    299
    literally
    bumped into this issue 5 minutes ago.
    love how those things get on the way of programming and we waste several hours instead of advancing in our project