// build the sprite and slots with the skeleton data private void BuildSkeleton(SkeletonData skeletonData) { skeleton = new Skeleton(skeletonData); skeleton.UpdateWorldTransform(); // check if there are multiple skins loaded if (skeleton.Data.Skins.Count > 0) { // load the first skin as default SetSkin(skeleton.Data.Skins[0].Name); } // build all the child sprites in the container, add them based on the slot draw order and create using the default slot/attachment for (int i = 0; i < skeleton.DrawOrder.Count; i++) { GSpineSlot slot = new GSpineSlot(skeleton.DrawOrder[i]); slots.Add(slot); AddChild(slot); } AnimationStateData animationStateData = new AnimationStateData(skeleton.Data); animation = new Spine.AnimationState(animationStateData); }
// build the sprite and slots with the skeleton data private void BuildSkeleton(SkeletonData skeletonData) { skeleton = new Skeleton(skeletonData); skeleton.UpdateWorldTransform(); // check if there are multiple skins loaded if(skeleton.Data.Skins.Count > 0){ // load the first skin as default SetSkin(skeleton.Data.Skins[0].Name); } // build all the child sprites in the container, add them based on the slot draw order and create using the default slot/attachment for(int i = 0; i < skeleton.DrawOrder.Count; i++){ GSpineSlot slot = new GSpineSlot(skeleton.DrawOrder[i]); slots.Add(slot); AddChild(slot); } AnimationStateData animationStateData = new AnimationStateData(skeleton.Data); animation = new Spine.AnimationState(animationStateData); }