Unity-Technologies / Addressables-Sample

Demo project using Addressables package
1.29k stars 298 forks source link

error display before enter the game #84

Closed absences closed 1 year ago

absences commented 1 year ago

there is my steps: Test.cs:

using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.U2D; using UnityEngine.UI;

public class Test : Image { // Start is called before the first frame update protected override void Start() { base.Start();

    Addressables.LoadAssetAsync<SpriteAtlas>("Atlas/hero.spriteatlas").Completed += OnCompleted;
}
void OnCompleted(AsyncOperationHandle<SpriteAtlas> op)
{
    sprite = op.Result.GetSprite("hero_icon_004");

    Addressables.Release(op);
}

}

then,play the game in editor, everything right. but exit the game ,hide unity window and reopen editor window(just refresh) , the "hero_icon_004" show in the scene(not playing!)

image

i guess something woring with inherit the UIBehaviour,