Created
November 24, 2017 20:49
-
-
Save anonymous/8f3733f3347c2886929a8e54455740ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const string MASTER_VOLUME_KEY = "master_volume"; | |
const string DIFFICULTY_KEY = "difficulty"; | |
const string LEVEL_KEY = "level_unlocked_"; | |
const string SURVIVAL_MODE_KEY = "survival_mode"; | |
public static void SetMasterVolume (float volume){ | |
if (volume >= 0f && volume <= 1f) { | |
PlayerPrefs.SetFloat (MASTER_VOLUME_KEY, volume); | |
} else { | |
Debug.LogError ("Master volume is out of range! Noooo!"); | |
} | |
} | |
public static float GetMasterVolume() { | |
return PlayerPrefs.GetFloat (MASTER_VOLUME_KEY); | |
} | |
public static void SetSurvivalMode(float survival){ | |
if (survival >= 0f && survival <= 1f) { | |
PlayerPrefs.SetFloat (SURVIVAL_MODE_KEY, survival); | |
} else { | |
Debug.LogError ("Survival mode is out of range!"); | |
} | |
} | |
public static float GetSurvivalMode (){ | |
return PlayerPrefs.GetFloat (SURVIVAL_MODE_KEY); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment