3
我有一個類似水果忍者的遊戲,使用Swift - > SpriteKit。一切工作正常在iOS 8上,但在iOS 9 SKEmitterNode有一些奇怪的行爲。這是我得到我的刀片影響兩個:SKEmitterNode iOS 8 vs iOS 9如何獲得相同的結果?
func emitterNodeWithColor(color:UIColor)->SKEmitterNode {
let emitterNode:SKEmitterNode = SKEmitterNode()
emitterNode.particleTexture = SKTexture(imageNamed: "spark.png")
emitterNode.particleBirthRate = 3000
emitterNode.particleLifetime = 0.2
emitterNode.particleLifetimeRange = 0
emitterNode.particlePositionRange = CGVectorMake(0.0, 0.0)
emitterNode.particleSpeed = 0.0
emitterNode.particleSpeedRange = 0.0
emitterNode.particleAlpha = 0.8
emitterNode.particleAlphaRange = 0.2
emitterNode.particleAlphaSpeed = -0.45
emitterNode.particleScale = 0.5
emitterNode.particleScaleRange = 0.001
emitterNode.particleScaleSpeed = -1
emitterNode.particleRotation = 0
emitterNode.particleRotationRange = 0
emitterNode.particleRotationSpeed = 0
emitterNode.particleColorBlendFactor = 1
emitterNode.particleColorBlendFactorRange = 0
emitterNode.particleColorBlendFactorSpeed = 0
emitterNode.particleColor = color
emitterNode.particleBlendMode = SKBlendMode.Add
return emitterNode
}
let emitter:SKEmitterNode = emitterNodeWithColor(color)
emitter.targetNode = target
emitter.zPosition = 0
tip.addChild(emitter)
這是我與所有的選項使用方法。兩者都是一樣的,但結果是不同的。任何想法如何使iOS 9中的效果與iOS 8相同?
我曾嘗試以下這一點,稍微修改爲我的遊戲,但是下面一行將無法正常工作 'GameScene .convertPoint(GameScene.convertPoint(self.position,fromNode:self.parent!),toNode:GameScene.worldLayers [.UnderCharacter]!)' –