Пример #1
0
    public void Die()
    {
        transform.GetComponent <GravityBody> ().gravityUp = spawnGravity;
        transform.rotation = spawnRotation;
        transform.position = spawn;
        transform.GetComponent <Rigidbody> ().velocity = new Vector3(0, 0, 0);

        BlackFades.FadeIn(1, Color.black);
    }
Пример #2
0
    void Start()
    {
        BlackFades.FadeIn(1.0F, Color.black);
        player = GameObject.Find("Player");

        cheatOnce         = true;
        pauseMenu.enabled = false;

        GameObject sensitivitySlider = pauseMenu.transform.Find("BG Panel").Find("Panel").Find("SensitivitySlider").gameObject;

        sensitivitySlider.GetComponent <Slider>().value = PlayerPrefs.GetFloat("Sensitivity", 260.0F);        //260.0F
        GameObject musicSlider = pauseMenu.transform.Find("BG Panel").Find("Panel").Find("MusicSlider").gameObject;

        musicSlider.GetComponent <Slider>().value = PlayerPrefs.GetFloat("MusicVolume", 0.2F);        //0.2F
        GameObject soundSlider = pauseMenu.transform.Find("BG Panel").Find("Panel").Find("SoundSlider").gameObject;

        soundSlider.GetComponent <Slider>().value = PlayerPrefs.GetFloat("SoundVolume", 0.5F);        //0.5F
        GameObject gammaSlider = pauseMenu.transform.Find("BG Panel").Find("Panel").Find("GammaSlider").gameObject;

        gammaSlider.GetComponent <Slider>().value = PlayerPrefs.GetFloat("Gamma", 1.0F); //1.0F

        if (PlayerPrefs.GetInt("Level Unlocked") > 1)                                    //if there are more levels unlocked than level 1, let him play them
        {
            unlockedLevel = PlayerPrefs.GetInt("Level Unlocked");
        }
        else
        {
            unlockedLevel = 1;
        }

        if (PlayerPrefs.GetInt("Current Level") > 1)         //if there are more levels unlocked than level 1, let him play them
        {
            currentLevel = PlayerPrefs.GetInt("Current Level");
        }
        else
        {
            currentLevel = 1;
        }

        if (PlayerPrefs.GetInt("Current Level") == 0)
        {
            if (Application.loadedLevelName == "Central")
            {
                unlockedLevel = 1;
                currentLevel  = 1;
                SaveGame();
                Application.LoadLevel("Central");
            }
        }
        SaveGame();
    }
Пример #3
0
 void Awake()
 {
     BlackFades.FadeIn(1.0F, Color.black);
 }