So after coming close to releasing my app, the production team decided the game would be more challenging and interactive if the majority of the levels were unlockable with an exp bar. The problem is, I’m currently using playerprefs to store my data, which doesn’t use bools. My gamecontroller scripts are only used for each level, rather than persisting which is how i designed it and i would really prefer they stay that way. I have a main menu where the level selection is, and four levels. What would be the best way of working around this?
Trying to follow what you’re saying and what you’re asking.
What would you like to see happen? A way to store xp/unlocked levels?
PlayerPrefs doesn’t store bools… Ok… it stores ints though? You can make ints that act like bools ![]()
See each of the levels keeps track of the exp and i have playerprefs doing that which is universal for all the levels, so keeping track of the exp is going great, however, the slider im using, when it reaches the max value of exp, it should level up so to speak, aka unlock a level. However I’m confused on how to make the main menu know to unlock a level once a level up has been done with the ui buttons im using.
Well, if they unlock sequentially you can just set an level variable to the right value when you unlock.
if they’re out of order you could just store 4 variables, 0 = not yet unlocked, 1 = unlocked.
Is it that easy or something else? ![]()
Hey thanks! You actually helped me lol sorry, it’s been a long night, I’ve been at it all day so i’m making dumb mistakes.
Hey, you’re welcome. No problem. It’s cool, I make many… then hopefully learn & go on
That’s life. heh.
Enjoy your game
For completeness it’s common to save bools by simply saving 0 for false and 1 for true.
Must be short books if the entire content is 0 or 1
Nice.