Quantcast
Channel: Questions in topic: "playerprefs"
Viewing all articles
Browse latest Browse all 1333

Toggable music and saving of music state

$
0
0
Hello, I'm working on an options menu but i kinda struck a wall. I have 2 toggles, one for music and one for sfx. I want to make so the game remembers users input and I'm using `switch (MusicInt)`switch for changing int, but it wont switch between cases. Also i cant get the game remember game state and switch. Thank you in advance! :) Switch Code: public static void Music() { int MusicInt = 1; switch (MusicInt) { case 1: MusicInt = 1; PlayerPrefs.SetInt("MusicM", MusicInt); break; case 2: MusicInt = 0; PlayerPrefs.SetInt("MusicM", MusicInt); break; } Debug.Log(MusicInt); }

Viewing all articles
Browse latest Browse all 1333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>