Project Information:
Platform-Android Unity Editor Version-2018.2.5f1
Scenario 1: The display of the UI referenced by the sprite under the atlas in the real machine is incorrect.
The following two solutions were found under our tests:
1. Before loading the corresponding UI, load the spriteAtlas to the memory in advance. (It is quite troublesome, you have to know which atlas your sprite belongs to, and you need a corresponding set of resource loading frameworks).
2. Call the callback provided by Unity, and manually locate and load the corresponding atlas. (Untiy2018 will provide coroutines for asynchronously loading atlases)
Here's why I wonder:
Test record: unity2017.3.0f3 SpriteAtlas for AB package: UnityEditor, check Include in Build, do not register atlasRequested, load UI prefab with Image, display UnityEditor normally, uncheck Include in Build, do not register atlasRequested, load with Image UI prefab does not display and warns SpriteAtlasManager.atlasRequested wasn't listened to while RGB requested. UnityEditor, check Include in Build, register atlasRequested, load UI prefab with Image, display normally, but do not trigger the atlasRequested event . UnityEditor, uncheck Include in Build, register atlasRequested, load UI prefab with Image, display normally, and trigger atlasRequested event. Android real machine, check Include in Build, do not register atlasRequested, load UI prefab with Image, display Android real machine, uncheck Include in Build, do not register atlasRequested, load UI preform with Image, display normally Pictures (strange) Android real machine, check Include in Build, register atlasRequested, do not load UI prefab with Image, display pictures normally, do not trigger atlasRequested event. Android real machine, do not check Include in Build, register atlasRequested, do not load UI prefab with Image, display pictures normally, but do not trigger the atlasRequested event (strange) Our project Unity2018 has a large number of UI (checked Include in Build) Sometimes a display error occurs, and it returns to normal after the registration event. So here is a bug of Unity?
Reference page: https://www.litefeel.com/blog/unity-2017-new-sprite-atlas/#comment-28099
Project development log: Build AssetBundle-SpriteAtlas (still a little confused)