Exemple #1
0
 void Start()
 {
     gameWon           = false;
     gameOver          = false;
     restart           = false;
     gameOverText.text = "";
     restartText.text  = "";
     score             = 0;
     UpdateScore();
     StartCoroutine(SpawnWaves());
     particles            = GameObject.FindObjectOfType <Particles>();
     particles2           = GameObject.FindObjectOfType <Particles2>();
     bG_Scroller          = GameObject.FindObjectOfType <BG_Scroller>();
     lighting             = GameObject.FindObjectOfType <Lighting>();
     mainMusicSource.clip = mainAudio;
     mainMusicSource.Play();
     mainMusicSource.loop = true;
 }
Exemple #2
0
    void Start()
    {
        win               = false;
        victory           = false;
        gameOver          = false;
        restart           = false;
        respawn           = false;
        fullrestart       = false;
        restartText.text  = "";
        gameOverText.text = "";
        score             = 0;
        lives             = 3;
        UpdateScore();
        UpdateLives();
        StartCoroutine(SpawnWaves());

        GameObject backgroundObject = GameObject.FindWithTag("Background");

        if (backgroundObject != null)
        {
            background = backgroundObject.GetComponent <BG_Scroller>();
        }

        GameObject starsObject = GameObject.FindWithTag("StarField");

        if (starsObject != null)
        {
            stars = starsObject.GetComponent <StarField>();
        }

        GameObject farstarsObject = GameObject.FindWithTag("FarStarField");

        if (farstarsObject != null)
        {
            farstars = farstarsObject.GetComponent <FarStarField>();
        }
    }