private void OnDestroy() { Shader.SetGlobalVector("_WaterFloodlevel", new Vector4(0f, this.PuddlesMinLevel, 0f, 0f)); Shader.SetGlobalFloat("_RainAmount", 0f); if (WaterOnTerrain.instance == this) { WaterOnTerrain.instance = null; } }
private void Awake() { WaterOnTerrain.Instance = this; Shader.SetGlobalVector("_WaterFloodlevel", new Vector4(0f, this.PuddlesMinLevel, 0f, 0f)); Shader.SetGlobalFloat("_RainAmount", 0f); }