How to Get a PlayerPrefsX boolean?

Hey everybody, I’m not particularly sure how to reference booleans that have and have not been created, yet, through playerPrefsX. I wrote for the boolean to save, but I did it while using variables, to create a unique name. So my boolean script looks like this:

PlayerPrefsX.SetBool(thisLevel + "TimeBadge", true);

That works fine and dandy, but how do I reference it in the current script or others?

For Example:
I want to make an if statement that determines whether or not that boolean is true. What would I type? I have fruitlessly tried this:



and some other failed experiments. Let me know if you would like to read those.

Also, I believe I need some type of for loop to help the system understand what to look for, because the playerprefsx booleans that don’t exist yet (the false ones), can’t load the technically false booleans. (makes sense, because they aren’t made until the BadgeBool achievement is unlocked)

Links / tips / tricks / etc all appreciated!

PlayerPrefsX.GetBool() is of the form:

static function GetBool(name : String, defaultValue : boolean) : boolean {

And you are not supplying a default value in the code you posted. So if you want to return false if a variable has not been set yet, then you would do:

if(PlayerPrefsX.GetBool(LVLnameTimeBadge, false)){

So if it finds the key, the boolean value (true or false) is returned. If it does not find the key, then the default value is returned. So there is no need for any kind of loop.