Esempio n. 1
0
 void Start()
 {
     AudioManager.GetInstance().PlayMusic("EndTheme");
     AudioManager.GetInstance().StopMusic("MainTheme");
     AudioManager.GetInstance().StopMusic("MoonTheme");
     TextOnScreen.FindObjectOfType <TextOnScreen>().Text11();
     StartCoroutine(fadeout(13));
 }
 // Start is called before the first frame update
 void Start()
 {
     AudioManager.GetInstance().PlaySoundLoop("RocketHum");
     TextOnScreen.FindObjectOfType <TextOnScreen>().Text8();
     StartCoroutine(Asteroid(15));
     StartCoroutine(Explode(20));
     StartCoroutine(LoadNextScene(32));
 }
Esempio n. 3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.name == "Battery")
     {
         TextOnScreen.FindObjectOfType <TextOnScreen>().Text6();
         AudioManager.GetInstance().PlaySoundOnce("Battery");
         StartCoroutine(LaserSound(1));
         StartCoroutine(Laser(5));
     }
 }
    IEnumerator Asteroid(float duration)
    {
        yield return(new WaitForSeconds(duration));

        asteroid.SetActive(true);
        TextOnScreen.FindObjectOfType <TextOnScreen>().Text9();
        AudioManager.GetInstance().PlaySoundLoop("WarningBeep");
        warningLights.SetActive(true);
        computertext.SetActive(false);
        warningText.SetActive(true);
        payloadText.SetActive(false);
    }
Esempio n. 5
0
    IEnumerator Explosion(float duration)
    {
        yield return(new WaitForSeconds(duration));

        if (!isExploded)
        {
            AudioManager.GetInstance().PlaySoundOnce("Explosion");
            Instantiate(explosion, new Vector3(181.77f, 603.61f, 1090f), Quaternion.identity);
            isExploded = true;
            TextOnScreen.FindObjectOfType <TextOnScreen>().Text7();
            homeTrigger.SetActive(true);
        }
    }
Esempio n. 6
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1) || Input.GetKeyDown(KeyCode.Keypad1))
        {
            AudioManager.GetInstance().PlaySoundOnce("Keyboard");
            if (arrayPos1 >= array1.Length - 1)
            {
                arrayPos1 = 0;
            }
            else
            {
                arrayPos1 += 1;
            }
        }
        if (Input.GetKeyDown(KeyCode.Alpha2) || Input.GetKeyDown(KeyCode.Keypad2))
        {
            AudioManager.GetInstance().PlaySoundOnce("Keyboard");
            if (arrayPos2 >= array2.Length - 1)
            {
                arrayPos2 = 0;
            }
            else
            {
                arrayPos2 += 1;
            }
        }
        if (Input.GetKeyDown(KeyCode.Alpha3) || Input.GetKeyDown(KeyCode.Keypad3))
        {
            AudioManager.GetInstance().PlaySoundOnce("Keyboard");
            if (arrayPos3 >= array3.Length - 1)
            {
                arrayPos3 = 0;
            }
            else
            {
                arrayPos3 += 1;
            }
        }
        if (Input.GetKeyDown(KeyCode.Alpha4) || Input.GetKeyDown(KeyCode.Keypad4))
        {
            AudioManager.GetInstance().PlaySoundOnce("Keyboard");
            if (arrayPos4 >= array4.Length - 1)
            {
                arrayPos4 = 0;
            }
            else
            {
                arrayPos4 += 1;
            }
        }
        if (Input.GetKeyDown(KeyCode.Alpha5) || Input.GetKeyDown(KeyCode.Keypad5))
        {
            AudioManager.GetInstance().PlaySoundOnce("Keyboard");
            if (arrayPos5 >= array5.Length - 1)
            {
                arrayPos5 = 0;
            }
            else
            {
                arrayPos5 += 1;
            }
        }
        if (Input.GetKeyDown(KeyCode.Alpha6) || Input.GetKeyDown(KeyCode.Keypad6))
        {
            AudioManager.GetInstance().PlaySoundOnce("Keyboard");
            if (arrayPos6 >= array6.Length - 1)
            {
                arrayPos6 = 0;
            }
            else
            {
                arrayPos6 += 1;
            }
        }
        if (Input.GetKeyDown(KeyCode.Alpha7) || Input.GetKeyDown(KeyCode.Keypad7))
        {
            AudioManager.GetInstance().PlaySoundOnce("Keyboard");
            if (arrayPos7 >= array7.Length - 1)
            {
                arrayPos7 = 0;
            }
            else
            {
                arrayPos7 += 1;
            }
        }


        letter1.text = array1[arrayPos1].ToString();
        letter2.text = array2[arrayPos2].ToString();
        letter3.text = array3[arrayPos3].ToString();
        letter4.text = array4[arrayPos4].ToString();
        letter5.text = array5[arrayPos5].ToString();
        letter6.text = array6[arrayPos6].ToString();
        letter7.text = array7[arrayPos7].ToString();

        if (array1[arrayPos1] == "n" &&
            array2[arrayPos2] == "o" &&
            array3[arrayPos3] == "t" &&
            array4[arrayPos4] == "h" &&
            array5[arrayPos5] == "i" &&
            array6[arrayPos6] == "n" &&
            array7[arrayPos7] == "g"
            )
        {
            Debug.Log("You have n!");

            if (!hasExploded)
            {
                Instantiate(explosion, new Vector3(-16.1F, 40.93f, -125.03f), Quaternion.identity);
                hasExploded = true;
                TextOnScreen.FindObjectOfType <TextOnScreen>().Text4();
                AudioManager.GetInstance().PlaySoundOnce("Explosion");
                AudioManager.GetInstance().PlaySoundOnce("RocketLaunch");
                rocket.SetActive(true);
                smoke.Play();
                Destroy(rocket, 15);
            }
            if (!doorIsOpen)
            {
                Debug.Log("Tried to open door");
                door.transform.Rotate(0, 68.92f, 0);
                secretDoor.SetActive(false);
                rocket2.SetActive(true);
                doorIsOpen = true;
            }
        }

        //if (Input.GetKeyDown(KeyCode.F))
        //{
        //    Instantiate(explosion, new Vector3(-16.1F, 40.93f, -125.03f), Quaternion.identity);
        //}
    }
Esempio n. 7
0
 // Start is called before the first frame update
 void Start()
 {
     TextOnScreen.FindObjectOfType <TextOnScreen>().Text5();
     AudioManager.GetInstance().PlayMusic("MoonTheme");
 }