Hello there,
I'm a newbie on Spine 2D. I want to build an avatar system : each available model have different skins.
I'm currently able to switch between skins, but i'm stuck when I need to switch between models : I can't figure out how to it properly.
Here is what i got, so far :
private SkeletonAnimation skeletonAnim; // previously instantiated successfully
TextAsset skeletonDataTextAsset= Resources.Load(path + "assetName" + "_SkeletonData.asset") as TextAsset;
TextAsset atlasTextAsset = Resources.Load(path + "assetName" + "_Atlas.asset") as TextAsset;
Material atlasMaterial = Resources.Load(path + "assetName" + "_Material.mat") as Material;
Material[] tabAtlas = { atlasMaterial }; // i got only 1 material on this model
AtlasAsset atlasAsset = AtlasAsset.CreateRuntimeInstance(atlasTextAsset, tabAtlas, true); // seems to fail
skeletonAnim.skeletonDataAsset = SkeletonDataAsset.CreateRuntimeInstance(
skeletonDataTextAsset, atlasAsset, true); // create a non-readable SkeletonDataAsset
-> my atlasAsset seems not to be loaded correctly as the console says : "Atlas file not set for atlas asset"
Am I looking for the wrong files ? Using wrong casts?
Do I need to make a "Reload" after these steps, like in the editor ?
In want to make it fully automatic, without drag'n drop in the editor, as there is a lot of models.
Do I need to have a totally different approach ?
Thanks for your time :time: