for (var value:String in bezugQuestlogArray.quest)
{
PlayerPrefsX.SetStringArray("Questlog", bezugQuestlogArray.quest);
}
In my debugger appears that error:
The best overload for the method ‘PlayerPrefsX.SetStringArray(String, String[ ])’ is not compatible with the argument list ‘(String, Array)’.
I dont know whats that mean, hope you can help me:(
Your code won’t work, since you’re iterating through the array, but attempting to save the array every iteration and doing nothing with the “value” variable. You should get rid of the for loop. Also, never use the JS Array class. It’s obsolete and ArrayPrefs will not work with it.
var quest= ["Quest1blablabla", "Quest2blablabla", "Quest3blablabla"]
Im currently pushing my questtext in my array everytime the player accepts a quest:
quest.push(mandredQuestApfel);
How can i change this to work with the needed string[ ] type, or is there another way to save my current quest array in player prefs?
This is really confusing
You could use a generic List, and then convert it to an array using ToArray before saving, and convert the array to a List when loading by passing the array into the constructor. e.g., “var foo = new List.(PlayerPrefsX.GetStringArray(“MyArray”));”