Closed eduardbosch closed 6 years ago
Hi to all š,
I was having trouble with loading assets from code in GUI mode. I don't know if I'm loading the data in a wrong way, but I just wanted to expose how I solved my problem.
The problem was that If I load the data like this:
UnityFactory.factory.LoadDragonBonesData("path/to/name_ske"); UnityFactory.factory.LoadTextureAtlasData("path/to/name_tex", isUGUI: true); UnityFactory.factory.BuildArmatureComponent("armatureName", isUGUI: true);
The loading process crashes here https://github.com/DragonBones/DragonBonesCSharp/blob/11bf7b74174a0cfc1dc71be138bba645d0a01ad2/Unity/Demos/Assets/DragonBones/Scripts/unity/UnityTextureAtlasData.cs#L171 because my DragonBones data had some slots with blending mode different than BlendModel.Normal, which causes the method _GetUIMaterial to search for the textureinstead of the uiTexture which is not loaded.
BlendModel.Normal
_GetUIMaterial
texture
uiTexture
So, when loading the UI texture, I think that we should also load the normal texture.
Let me know if I'm loading the data in a wrong way or this is a current bug.
Thanks a lot!
I think that this commit 11bf7b74174a0cfc1dc71be138bba645d0a01ad2 might fix the bug I tried to solve with this PR, so I close it.
Hi to all š,
I was having trouble with loading assets from code in GUI mode. I don't know if I'm loading the data in a wrong way, but I just wanted to expose how I solved my problem.
The problem was that If I load the data like this:
The loading process crashes here https://github.com/DragonBones/DragonBonesCSharp/blob/11bf7b74174a0cfc1dc71be138bba645d0a01ad2/Unity/Demos/Assets/DragonBones/Scripts/unity/UnityTextureAtlasData.cs#L171 because my DragonBones data had some slots with blending mode different than
BlendModel.Normal
, which causes the method_GetUIMaterial
to search for thetexture
instead of theuiTexture
which is not loaded.So, when loading the UI texture, I think that we should also load the normal texture.
Let me know if I'm loading the data in a wrong way or this is a current bug.
Thanks a lot!