maxgribov / Spine

Unofficial Spine runtime Swift library, allows you to play animations created in the Spine app (http://esotericsoftware.com).
MIT License
188 stars 36 forks source link

SetSkin #17

Closed zerogone01 closed 1 year ago

zerogone01 commented 5 years ago

Hello! I tried to added a second skin.. but this doesn't work. First of all, Skin HeadColor1, works fine but the second "HairStyle1" not is showing. What si happened?

Regards and thanks for your help!

        override func didMove(to view: SKView) {

            if let character = Skeleton(fromJSON: "skeleton", atlas: "Skin", skin: "HeadColor1"){

                character.name = "Girl_Avatar"
                character.position = CGPoint(x: 0, y: 0)
                character.setScale(0.2)
                self.addChild(character)
                if let walkAnimation = character.animation(named: "Idle") {

                    character.run(SKAction.repeatForever(walkAnimation))
                }

                character.applySkin(named: "HairStyle1") //This line doesn't work! 
            }
        }
maxgribov commented 5 years ago

Something is wrong with the way you added assets to the project. Try to read this manual carefully and do everything carefully step by step: https://github.com/maxgribov/Spine/wiki/Assets