当我从GameScene(SKScene)转移到Market(UIViewController)并返回时,FPS会降低。你能说出为什么? ,问题在哪里? MarketView是空的,没有证据,只有通过协议(SKScne)执行的转换,它绑定了GameScene和GameViewController。代码:
//GameScene
import SpriteKit
protocol GameDelegate {
func Market()
func Question()
}
...
func returnToMarket(){
self.viewController.Market()
}
// GameViewController
class GameViewController: UIViewController , GameDelegate{
func Market() {
let storyBoard : UIStoryboard = UIStoryboard(name: "Market", bundle: nil)
let vc : UIViewController = storyBoard.instantiateViewControllerWithIdentifier("Market")
self.presentViewController(vc, animated: true, completion: nil)
}
...
}
// Market(UIViewController)
func ReturnToMainMeny() {
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let vc : UIViewController = storyBoard.instantiateViewControllerWithIdentifier("GameViewController")
self.presentViewController(vc, animated: true, completion: nil)
}