Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        gameManagerRef = GameObject.Find("GameManager").GetComponent <GameManager>();
        treadMillRef   = GameObject.Find("Treadmill").GetComponent <TreadmillScript>();
        //stayRef = GameObject.Find("StayObj").GetComponent<StayScript>();
        rb             = GetComponent <Rigidbody>();
        startGreyColor = GetComponent <Renderer>().materials[0].color;
        source         = GetComponent <AudioSource>();
        StartCoroutine(ShipUpandDown());
        //orb.Play();

        if (PlayerPrefs.GetInt("HighScore") < 10)
        {
            //shipScrollCounter = 0;
            shipMod = 0;
            rightArrowObj.SetActive(false);
            leftArrowObj.SetActive(false);
        }
        else if (PlayerPrefs.GetInt("HighScore") >= 10 && PlayerPrefs.GetInt("HighScore") < 20)
        {
            //myMats[0] = prestiges[0];

            //shipScrollCounter = 1;
            shipMod = 1;
            //GetComponent<Renderer>().material.color = Color.cyan;
        }
        else if (PlayerPrefs.GetInt("HighScore") >= 20 && PlayerPrefs.GetInt("HighScore") < 30)
        {
            //shipScrollCounter = 2;
            shipMod = 2;
        }
        else if (PlayerPrefs.GetInt("HighScore") >= 30 && PlayerPrefs.GetInt("HighScore") < 40)
        {
            //shipScrollCounter = 3;
            shipMod = 3;
        }
        else if (PlayerPrefs.GetInt("HighScore") >= 40 && PlayerPrefs.GetInt("HighScore") < 50)
        {
            //shipScrollCounter = 4;
            shipMod = 4;
        }
        else if (PlayerPrefs.GetInt("HighScore") >= 50 && PlayerPrefs.GetInt("HighScore") < 60)
        {
            //shipScrollCounter = 5;
            shipMod = 5;
        }
        else if (PlayerPrefs.GetInt("HighScore") >= 60)
        {
            //shipScrollCounter = 5;
            shipMod = 6;
        }

        shipScrollCounter = PlayerPrefs.GetInt("CurrentShip");
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        levelRenderer = this.GetComponentInChildren <MeshRenderer>();
        treadScript   = GameObject.Find("Treadmill").GetComponent <TreadmillScript>();
        rb            = this.GetComponent <Rigidbody>();
        source        = GetComponent <AudioSource>();

        if (source != null)
        {
            source.PlayOneShot(missileSound, 0.035f);
        }
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        treadMill = GameObject.Find("Treadmill").GetComponent <TreadmillScript>();
        StartCoroutine(RecSwitch());
        player  = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerScript>();
        stayRef = GameObject.Find("StayObj").GetComponent <StayScript>();

        source = GetComponent <AudioSource>();
        //PlayerPrefs.SetInt("HighScore", 60);
        source.PlayOneShot(camCorder, 0.7f);
        //source.PlayOneShot(themeSong, 0.35f);
        source.PlayOneShot(NightSounds, 0.55f);


        //wait = themeSong.length;
        wait2   = NightSounds.length;
        incOnce = false;
    }