/// <summary> /// Starts the game. Should be called after the player sits in a chair /// </summary> public void StartGame() { //Debug.Log("game proc start"); isPaused = false; if (currentQuestionNumber == 0) { UIManager.instance.ResetMoneyTreePanel(); gameFormat = new ClassicGameFormat(); difficlutyLevel = 1; //currentQuestionNumber = 0; musicAudioSource.Stop(); musicAudioSource.PlayOneShot(classicModeAudio[11]); StartCoroutine(LetsPlayLD()); LightAnimation.SmallCircleUp(); } //else //{ // UIManager.uim.LoadGameUI(); // ContinueGameProcess(); //} UIManager.instance.confetti.SetActive(false); }
/// <summary> /// Starts the game. Should be called after the player sits in a chair /// </summary> public void StartGame() { UIManager.uim.gameObject.GetComponent <AudioSource>().enabled = false; gameFormat = new ClassicGameFormat(); difficlutyLevel = 1; currentQuestionNumber = 0; audioSource.PlayOneShot(classicModeAudio[11]); StartCoroutine(LetsPlayLD()); LightAnimation.SmallCircleUp(); }
void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { if (Application.loadedLevel == 0) { Back(); } else { pausePanel.SetActive(!pausePanel.activeSelf); } } if (Input.GetKeyDown(KeyCode.M) && GameProcess.gp.state != State.GAME_IS_NOT_STARTED) { //opening/closing Money Tree Panel if (moneyTreePanel.activeSelf) { StartCoroutine(CloseMoneyTreePanel()); } else { StartCoroutine(ShowMoneyTreePanel()); } } else if (Input.GetKeyDown(KeyCode.Keypad1)) { LightAnimation.SmallCircleUp(); } else if (Input.GetKeyDown(KeyCode.Keypad2)) { LightAnimation.SmallCircleDown(); } else if (Input.GetKeyDown(KeyCode.Keypad3)) { LightAnimation.BigCircleUp(); } else if (Input.GetKeyDown(KeyCode.Keypad4)) { LightAnimation.BigCircleDown(); } }
public void PlaySound() { //if its first 5 questions if (currentQuestionNumber < 5) { if (state == State.WAITING_ANSWER) { //LightAnimation.SmallCircleDown(); //LightAnimation.BigCircleDown(); if (currentQuestionNumber == 1) { musicAudioSource.PlayOneShot(classicModeAudio[12]); DOVirtual.DelayedCall(classicModeAudio[12].length + 0.2f, CheckIfMusicIsPlaying); } } else if (state == State.WRONG_ANSWER) { musicAudioSource.Stop(); musicAudioSource.PlayOneShot(classicModeAudio[13]); } else if (state == State.CORRECT_ANSWER) { //LightAnimation.SmallCircleUp(); //LightAnimation.BigCircleUp(); soundsAudioSource.PlayOneShot(classicModeAudio[14]); } } //if it's 5-15 question else { if (state == State.WAITING_ANSWER) { //if it's question 5-15 question sound index (5*i-13) if (currentQuestionNumber != 5) { musicAudioSource.Stop(); LightAnimation.SmallCircleUp(); //LightAnimation.BigCircleUp(); LightAnimation.TurnOffBigCircle(); musicAudioSource.PlayOneShot(classicModeAudio[5 * currentQuestionNumber - 13]); //Debug.Log("Sound: " + classicModeAudio[5 * currentQuestionNumber - 13].name); } } else if (state == State.FINAL_ANSWER_GIVEN) { if (currentQuestionNumber != 5) { musicAudioSource.Stop(); musicAudioSource.PlayOneShot(classicModeAudio[5 * currentQuestionNumber - 12]); //Debug.Log("Sound: " + classicModeAudio[5 * currentQuestionNumber - 12].name); } } else if (state == State.WRONG_ANSWER) { musicAudioSource.Stop(); musicAudioSource.PlayOneShot(classicModeAudio[5 * currentQuestionNumber - 11]); //Debug.Log("Sound: " + classicModeAudio[5 * currentQuestionNumber - 11].name); } else if (state == State.CORRECT_ANSWER) { soundsAudioSource.Stop(); StartCoroutine(PlayCorrectThenLDSound()); } else if (state == State.MILLION_WON) { musicAudioSource.Stop(); musicAudioSource.PlayOneShot(classicModeAudio[65]); DOVirtual.DelayedCall(classicModeAudio[65].length + 4f, delegate { if (!musicAudioSource.isPlaying && state == State.GAME_IS_NOT_STARTED) { PlayMainTheme(); } }); } } }
public void PlaySound() { //if its first 5 questions if (currentQuestionNumber < 5) { if (state == State.WAITING_ANSWER) { LightAnimation.SmallCircleDown(); LightAnimation.BigCircleDown(); if (currentQuestionNumber == 1) { audioSource.PlayOneShot(classicModeAudio[12]); } } else if (state == State.WRONG_ANSWER) { audioSource.PlayOneShot(classicModeAudio[13]); } else if (state == State.CORRECT_ANSWER) { LightAnimation.SmallCircleUp(); LightAnimation.BigCircleUp(); audioSource.PlayOneShot(classicModeAudio[14]); } } //if it's 5-15 question else { if (state == State.WAITING_ANSWER) { //if it's question 5-15 question sound index (5*i-13) if (currentQuestionNumber != 5) { audioSource.Stop(); LightAnimation.SmallCircleUp(); LightAnimation.BigCircleUp(); audioSource.PlayOneShot(classicModeAudio[5 * currentQuestionNumber - 13]); Debug.Log("Sound: " + classicModeAudio[5 * currentQuestionNumber - 13].name); } } else if (state == State.FINAL_ANSWER_GIVEN) { if (currentQuestionNumber != 5) { audioSource.Stop(); audioSource.PlayOneShot(classicModeAudio[5 * currentQuestionNumber - 12]); Debug.Log("Sound: " + classicModeAudio[5 * currentQuestionNumber - 12].name); } } else if (state == State.WRONG_ANSWER) { audioSource.Stop(); audioSource.PlayOneShot(classicModeAudio[5 * currentQuestionNumber - 11]); Debug.Log("Sound: " + classicModeAudio[5 * currentQuestionNumber - 11].name); } else if (state == State.CORRECT_ANSWER) { audioSource.Stop(); StartCoroutine(PlayCorrectThenLDSound()); } } }