public void Began() { if (GameController.currentState == gameState.PLAY) { switch (nomeBotao) { case "cor": _background.ChangeColor(); break; case "pulo": _player.Jump(); break; case "fase": SceneManager.LoadScene(nomeFases); break; case "texto": _texto.ExecutaSoletrar(); GameController.currentState = gameState.TEXTO; break; } } else if (GameController.currentState == gameState.TEXTO) { if (nomeBotao == "texto") { _texto.campoTexto.text = ""; GameController.currentState = gameState.PLAY; } } }
private void Start() { InitializeMobileAds(); Application.targetFrameRate = 60; int levelNumber = Prefs.GetLevel(); ui.SetCurrentLevel(levelNumber); ui.SetCoins(coins); background.ChangeColor(levelNumber); currentLevel = levelGenerator.GenerateLevel(levelNumber); nextLevel = levelGenerator.GenerateLevel(levelNumber + 1); RequestInterstitial(); Prefs.SetPowerup(0); }
void KeyboardCalls() { if (Input.GetKey(KeyCode.LeftShift)) { _player.Run(Input.GetAxisRaw("Horizontal")); } else { _player.Walk(Input.GetAxisRaw("Horizontal")); } if (Input.GetAxisRaw("Vertical") == 1 || Input.GetKeyDown(KeyCode.Space)) { _player.Jump(); } if (Input.GetKeyDown(KeyCode.X)) { _background.ChangeColor(); } }
void KeyboardCalls() { //Controles no teclado: if (Input.GetKeyDown(KeyCode.Z)) { _player.Run(Input.GetAxisRaw("Horizontal")); } else { _player.Walk(Input.GetAxisRaw("Horizontal")); } if (Input.GetAxisRaw("Vertical") == 1 || Input.GetKeyDown(KeyCode.Space)) { _player.Jump(); } if (Input.GetKeyDown(KeyCode.X)) { _background.ChangeColor(); } }