Swift - 从一个SKScene转换到UIViewController并返回的FPS减少

时间:2015-10-06 17:29:41

标签: xcode swift uiviewcontroller frame-rate skscene

当我从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)

}

0 个答案:

没有答案