Example #1
0
    /*IEnumerator WaitForTenSeconds() {
     *      Debug.Log("In the CoRoutine");
     *      yield return new WaitForSeconds(10);
     *      Debug.Log("Ten Seconds Over");
     *      if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null))
     *      {
     *              Debug.Log("Stopping the reconstruction");
     *              mReconstructionBehaviour.Reconstruction.Stop();
     *      }
     * }*/

    void stopReconstruction()
    {
        if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null))
        {
            Debug.Log("Stopping the reconstruction");
            mReconstructionBehaviour.Reconstruction.Stop();
        }

        topPanel.SetActive(!topPanel.activeInHierarchy);
        //menuButton.SetActive (!menuButton.activeInHierarchy);

        Animator meshToClearAnimator = this.GetComponentInChildren <Animator> ();

        meshToClearAnimator.Play("FadeMeshToClear");

        greenKart.SetActive(true);
        //newCar.SetActive(true);

        CountDownScript countDown = GameObject.FindObjectOfType <CountDownScript> ();

        //countDown.timeLeft = 60.0f;
        countDown.timeLeft  = GameObject.FindObjectOfType <TimeBetweenScenes>().TimeForRound;
        countDown.runScript = true;

        CoinSpawningSystem css = GameObject.FindObjectOfType <CoinSpawningSystem> ();

        css.setCoinSpawnEnabled(true);

        //GameObject.Find ("GoButton").SetActive (false);

        goButton.SetActive(!goButton.activeInHierarchy);
        resetButton.SetActive(!resetButton.activeInHierarchy);

        bottomPanel.SetActive(true);
    }
Example #2
0
    // Handler for when the user clicks "Go!" to start the game. Ends construction of the ground mesh
    public void stopReconstruction()
    {
        if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null))
        {
            Debug.Log("Stopping the reconstruction");
            mReconstructionBehaviour.Reconstruction.Stop();
        }

        // Activate the top panel for in-game play
        topPanel.SetActive(!topPanel.activeInHierarchy);

        // Fades mesh to clear
        Animator meshToClearAnimator = this.GetComponentInChildren <Animator> ();

        meshToClearAnimator.Play("FadeMeshToClear");

        // Player appears on the screen
        greenKart.SetActive(true);

        // Sets the timer for the round
        CountDownScript countDown    = GameObject.FindObjectOfType <CountDownScript> ();
        float           timeForRound = 30f;

        if (GameObject.FindObjectOfType <TimeBetweenScenes> () != null)
        {
            timeForRound = GameObject.FindObjectOfType <TimeBetweenScenes> ().TimeForRound;
        }
        countDown.timeLeft  = timeForRound;
        countDown.runScript = true;

        // Starts spawning coins
        CoinSpawningSystem css = GameObject.FindObjectOfType <CoinSpawningSystem> ();

        css.setCoinSpawnEnabled(true);

        // Set necessary panels active or inactive
        goButton.SetActive(false);
        resetButton.SetActive(false);
        controls.SetActive(true);

        // Play the in game music
        GameObject.FindObjectOfType <SoundController>().playInGameMusic();
    }
Example #3
0
    void startMatch()
    {
        // Sets the timer for the round
        CountDownScript countDown    = GameObject.FindObjectOfType <CountDownScript> ();
        float           timeForRound = 30f;

        if (GameObject.FindObjectOfType <TimeBetweenScenes> () != null)
        {
            timeForRound = GameObject.FindObjectOfType <TimeBetweenScenes> ().TimeForRound;
        }
        countDown.timeLeft  = timeForRound;
        countDown.runScript = true;

        // Starts spawning coins
        CoinSpawningSystem css = GameObject.FindObjectOfType <CoinSpawningSystem> ();

        css.setCoinSpawnEnabled(true);

        // Play the in game music
        GameObject.FindObjectOfType <SoundController>().playInGameMusic();
    }
Example #4
0
 public void setSpawner(CoinSpawningSystem spawner)
 {
     this.spawner = spawner;
 }