public IEnumerator TurningTutorial() { playerAudioSource.PlayOneShot(TutorialVoiceLines[0]); yield return(new WaitForSeconds(TutorialVoiceLines[0].length + 0.25f)); currentEnemy = new enemy(new Vector3(0, 0, -25), 0.0f, EnemyType.ghost); yield return(new WaitForSeconds(4.0f)); playerAudioSource.PlayOneShot(TutorialVoiceLines[1]); yield return(new WaitForSeconds(TutorialVoiceLines[1].length + 1.0f)); currentEnemy.kill(); currentEnemy = new enemy(new Vector3(-25, 0, 0), 0.0f, EnemyType.ghost); yield return(new WaitForSeconds(4.0f)); playerAudioSource.PlayOneShot(TutorialVoiceLines[2]); yield return(new WaitForSeconds(TutorialVoiceLines[2].length)); allowturning = true; }
// Update is called once per frame void Update() { #if UNITY_ANDROID if (MobileInput.getInput() == MobileInput.InputType.hold) { SceneManager.LoadScene("TitleScreen"); } if (allowturning && MobileInput.getInput() == MobileInput.InputType.left) { allowturning = false; StartCoroutine(rotatePlayer(transform.rotation, transform.rotation * Quaternion.Euler(0, 90, 0), 0.25f)); StartCoroutine(SwitchWeaponTutorial()); } if (allowWeaponSwitch && MobileInput.getInput() == MobileInput.InputType.down) { weapon++; allowWeaponSwitch = false; if (weapon == 1) { playerAudioSource.PlayOneShot(weaponEquipSound[(int)PlayerWeapons.magic_staff]); StartCoroutine(AttackTutorial()); } if (weapon == 2) { playerAudioSource.PlayOneShot(weaponEquipSound[(int)PlayerWeapons.sword]); allowAttack = true; } if (weapon == 3) { playerAudioSource.PlayOneShot(weaponEquipSound[(int)PlayerWeapons.hammer]); allowAttack = true; } } if (allowAttack && MobileInput.getInput() == MobileInput.InputType.up) { allowAttack = false; if (weapon == 1) { currentEnemy.kill(); playerAudioSource.PlayOneShot(enemyDeaths[(int)EnemyType.ghost]); StartCoroutine(EnemyMoveTutorial()); } if (weapon == 2) { currentEnemy.kill(); playerAudioSource.PlayOneShot(enemyDeaths[(int)EnemyType.wolf]); StartCoroutine(BugTutorial()); } if (weapon == 3) { currentEnemy.kill(); playerAudioSource.PlayOneShot(enemyDeaths[(int)EnemyType.insect]); StartCoroutine(FinishedTutorial()); } } #endif if (allowturning && Input.GetKeyDown("left")) { allowturning = false; StartCoroutine(rotatePlayer(transform.rotation, transform.rotation * Quaternion.Euler(0, 90, 0), 0.25f)); StartCoroutine(SwitchWeaponTutorial()); } if (allowWeaponSwitch && Input.GetKeyDown("down")) { weapon++; allowWeaponSwitch = false; if (weapon == 1) { playerAudioSource.PlayOneShot(weaponEquipSound[(int)PlayerWeapons.magic_staff]); StartCoroutine(AttackTutorial()); } if (weapon == 2) { playerAudioSource.PlayOneShot(weaponEquipSound[(int)PlayerWeapons.sword]); allowAttack = true; } if (weapon == 3) { playerAudioSource.PlayOneShot(weaponEquipSound[(int)PlayerWeapons.hammer]); allowAttack = true; } } if (allowAttack && Input.GetKeyDown("up")) { allowAttack = false; if (weapon == 1) { currentEnemy.kill(); playerAudioSource.PlayOneShot(enemyDeaths[(int)EnemyType.ghost]); StartCoroutine(EnemyMoveTutorial()); } if (weapon == 2) { currentEnemy.kill(); playerAudioSource.PlayOneShot(enemyDeaths[(int)EnemyType.wolf]); StartCoroutine(BugTutorial()); } if (weapon == 3) { currentEnemy.kill(); playerAudioSource.PlayOneShot(enemyDeaths[(int)EnemyType.insect]); StartCoroutine(FinishedTutorial()); } } }