diff --git a/GoldWars/GoldWars/Scenes/MenuScene.swift b/GoldWars/GoldWars/Scenes/MenuScene.swift index 6818207..115c615 100644 --- a/GoldWars/GoldWars/Scenes/MenuScene.swift +++ b/GoldWars/GoldWars/Scenes/MenuScene.swift @@ -70,15 +70,17 @@ class MenuScene: SKScene { } override func update(_ currentTime: TimeInterval) { - if entityManager.entities.count != 0 { - entityManager.getBackground()!.update(deltaTime: currentTime) - entityManager.getButtonByName(buttonName: "startGameButton").component(ofType: ButtonComponent.self)?.buttonNode.isEnabled = GameCenterManager.isAuthenticated - } - - if GameCenterManager.sharedInstance.initIsFinish { - self.loadScene(scene: GameCenterManager.sharedInstance.gameScene!) - } - + StateManager.stateManager.stateMachine!.update(deltaTime: currentTime) + /* + if entityManager.entities.count != 0 { + entityManager.getBackground()!.update(deltaTime: currentTime) + entityManager.getButtonByName(buttonName: "startGameButton").component(ofType: ButtonComponent.self)?.buttonNode.isEnabled = GameCenterManager.isAuthenticated + } + + if GameCenterManager.sharedInstance.initIsFinish { + self.loadScene(scene: GameCenterManager.sharedInstance.gameScene!) + } + */ } - + } diff --git a/GoldWars/GoldWars/States/MenuState.swift b/GoldWars/GoldWars/States/MenuState.swift index 7dba33b..234b0c8 100644 --- a/GoldWars/GoldWars/States/MenuState.swift +++ b/GoldWars/GoldWars/States/MenuState.swift @@ -22,14 +22,14 @@ class MenuState: GKState { } override func update(deltaTime seconds: TimeInterval) { - /* if menuEM.entities.count != 0 { - menuEM.getBackground()!.update(deltaTime: seconds) + if menuEM.entities.count != 0 { + menuEM.getBackground()!.update(deltaTime: seconds) menuEM.getButtonByName(buttonName: "startGameButton").component(ofType: ButtonComponent.self)?.buttonNode.isEnabled = GameCenterManager.isAuthenticated } if GameCenterManager.sharedInstance.initIsFinish { StateManager.stateManager.menuSc!.loadScene(scene: GameCenterManager.sharedInstance.gameScene!) - }*/ + } } override func didEnter(from previousState: GKState?) {