SpriteKit: Passing data between scenes

前端 未结 6 793
无人共我
无人共我 2020-12-09 13:04

I am stuck trying to pass data between scenes \"SKScene\" in SpriteKit. For instance I would like to pass the score from level A to Level B.

Maybe the solution is ar

6条回答
  •  时光取名叫无心
    2020-12-09 13:30

    Where/how are you transitioning between the scenes? If could you show just the code where you create your new scene that would help. I may be missing the point of the question but if you have a 'scene manager'/navigator of some sort to do this then simply save the score in a local var temporarily and pass that into your new scene.

提交回复
热议问题