我有一些动画启动屏幕的代码,但是,在运行时,启动屏幕根本不做任何事情。这是我的代码:
import SpriteKit
import GameplayKit
class GameScene: SKScene {
let fadeOut = SKAction.fadeOut(withDuration:2)
let fadeIn = SKAction.fadeIn(withDuration: 2)
override func didMove(to view: SKView) {
let startScreen = SKSpriteNode()
startScreen.self.childNode(withName: "startScreen")
startScreen.run(fadeOut) {
startScreen.texture = SKTexture(imageNamed:"pong")
}
startScreen.run(fadeIn)
startScreen.run(fadeOut) {
startScreen.alpha = 0.0
startScreen.zPosition = -2
}
}
}