How do I determine if an AssetReference is currently loaded?

If you are trying to determine if a ScriptableObject accessed via AssetReference is loaded or not I can’t see a clear method.

Any ideas? I get warning spam in the log about unloading an unloaded asset since I can’t tell if its already unloaded or not.

any info on this?

cache the AsyncOperationHandle.

public AssetRefereceT<Texture2D> someAssetRef;
private AsyncOperationHandle<Texture2D> someHandle;

private void OnEnable(){
   someHandle = someAssetRef.LoadAssetAsync();
}

private void OnDisable(){
  Addressable.Release(someHandle);
  someHandle = default;
}

private void Update(){

   var isLoaded = someHandle.IsValid() && someHandle.IsDone;
   if(!isLoaded) return;
   var texture = someHandle.Result;
   //do somthing....

}

cool thanks
i think then it could be done using the asset reference directly since they hace the public extensions of IsValid and IsDone

Please avoid necroposting. Instead, it’s always best practice to create a new thread. I’m going to lock this thread. Please create a new one if you wish to discuss this.