Coder Social home page Coder Social logo

Comments (5)

KeyleXiao avatar KeyleXiao commented on August 28, 2024

Sampe1.cs.zip

Yesterday night , I found a bug in Addressables [1.1.10] o_O

When I loading error path , AsyncOperationStatus told me “None” , and try loading again AsyncOperationStatus told me “Failed” , I think the second status is right or the first status is a bug .

What’s the different between first load and second load ? ?

TestCode: Sampe1.cs

image

The First Click !
image

Then Click The Button Again ! We can see the “Right Error Info” , Status is Failed .
image

from addressables-sample.

KeyleXiao avatar KeyleXiao commented on August 28, 2024

I found out the different between first load and second load , in fact when i click the load button , Addressable will execute InitializeAsync (the function is delay execute) . when i click load button again InitializeAsync function are complete . so the AsyncOperationStatus is right.

from addressables-sample.

KeyleXiao avatar KeyleXiao commented on August 28, 2024

image

from addressables-sample.

KeyleXiao avatar KeyleXiao commented on August 28, 2024
IEnumerator loadRes()
{
    yield return Addressables.InitializeAsync();
 
    var operationHandle = Addressables.LoadAssetAsync<GameObject>(loadPath);

    Debug.Log(operationHandle.Status.ToString());

    if (operationHandle.Status == AsyncOperationStatus.Failed)
    {
        Debug.Log("load failed");
        yield break;
    }
}

if you want to load asset like this, must run [ Addressables.InitializeAsync() ] function first.

Goodnight !

from addressables-sample.

kirstenpilla avatar kirstenpilla commented on August 28, 2024

Hi @KeyleXiao thanks for investigating this! One thing I would suggest is to avoid depending on the value of operationHandle.Status until after the operationHandle has completed. The operation is asynchronous so it's not guaranteed that the Status will always be the same value at a particular frame.

from addressables-sample.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.