在 Appdelegate.swift 中调用函数

call function in Appdelegate.swift

我在gamescene.swift中有这个功能:

func pauseGame() {

    scene!.view!.paused = true
    println("pause")
    updateScoreTimer.invalidate()

}

现在我想从 AppDelegate.swift 调用它,但我不知道要将什么插入“<#GameScene#>”

GameScene.pauseGame(<#GameScene#>)

好吧,如果您的 AppDelegate.swift 实例化场景,您将从应用程序委托调用场景实例上的方法。但是我不明白你为什么要从 appDelegate 暂停游戏。您要在应用启动时调用它吗?