我不能放GKGameCenterControllerDelegate
在我的班上。并且GameKit
已导入
我的按钮到达引导板工作,它具有关闭它的功能,但是当我按下完成时它不会关闭。
我试着像这样写
代码:
class GameScene: SKScene, GKGameCenterControllerDelegate {
这是我在“gc.gameCenterDelegate = self
”
let location2 = touch.locationInNode(self)
if self.nodeAtPoint(location) == self.TrophyButton {
var vc = self.view?.window?.rootViewController
var gc = GKGameCenterViewController()
gc.gameCenterDelegate = self
vc?.presentViewController(gc, animated: true, completion: nil)
funcgameCenterViewControllerDidFinish(gameCenterViewController: GKGameCenterViewController!)
{
gameCenterViewController.dismissViewControllerAnimated(true, completion: nil)
}