updated update method of menuState

This commit is contained in:
Chauntalle Schüle 2020-05-29 22:42:38 +02:00
parent 78c5016576
commit 0492ab7724
2 changed files with 15 additions and 13 deletions

View File

@ -70,15 +70,17 @@ class MenuScene: SKScene {
} }
override func update(_ currentTime: TimeInterval) { override func update(_ currentTime: TimeInterval) {
if entityManager.entities.count != 0 { StateManager.stateManager.stateMachine!.update(deltaTime: currentTime)
entityManager.getBackground()!.update(deltaTime: currentTime) /*
entityManager.getButtonByName(buttonName: "startGameButton").component(ofType: ButtonComponent.self)?.buttonNode.isEnabled = GameCenterManager.isAuthenticated 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!)
}
if GameCenterManager.sharedInstance.initIsFinish {
self.loadScene(scene: GameCenterManager.sharedInstance.gameScene!)
}
*/
} }
} }

View File

@ -22,14 +22,14 @@ class MenuState: GKState {
} }
override func update(deltaTime seconds: TimeInterval) { override func update(deltaTime seconds: TimeInterval) {
/* if menuEM.entities.count != 0 { if menuEM.entities.count != 0 {
menuEM.getBackground()!.update(deltaTime: seconds) menuEM.getBackground()!.update(deltaTime: seconds)
menuEM.getButtonByName(buttonName: "startGameButton").component(ofType: ButtonComponent.self)?.buttonNode.isEnabled = GameCenterManager.isAuthenticated menuEM.getButtonByName(buttonName: "startGameButton").component(ofType: ButtonComponent.self)?.buttonNode.isEnabled = GameCenterManager.isAuthenticated
} }
if GameCenterManager.sharedInstance.initIsFinish { if GameCenterManager.sharedInstance.initIsFinish {
StateManager.stateManager.menuSc!.loadScene(scene: GameCenterManager.sharedInstance.gameScene!) StateManager.stateManager.menuSc!.loadScene(scene: GameCenterManager.sharedInstance.gameScene!)
}*/ }
} }
override func didEnter(from previousState: GKState?) { override func didEnter(from previousState: GKState?) {