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); }
private void Awake() { DontDestroyOnLoad(this); m_Instance = this; Shader blendShader = noZTest.shader; m_Material = new Material(blendShader); //m_Material = new Material("Shader \"Plane/No zTest\" { SubShader { Pass { Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Off Fog { Mode Off } BindChannels { Bind \"Color\",color } } } }"); }
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(); }
public void FadeDie() { BlackFades.FadeInOut(1.0f, 1.0f, Color.black); Invoke("Die", 1.0f); }
void Awake() { BlackFades.FadeIn(1.0F, Color.black); }