PlayerPrefs. Adding multiple strings on a List and saving it on PlayerPrefs.

Hello guys,
I really need your help. I’m stuck. I’m saving my string to PlayerPrefs but the strings on index 3 will overwrite and causes Out of Range error when I’m saving it again.
Here’s my code.(Updated)

private void BallSkinSave()
{
    if (PlayerPrefs.HasKey("skinCount"))
    {
        Debug.Log("already exist  " + skinCount);
        getSkinCount = PlayerPrefs.GetInt("skinCount");
        getSkinCount++;
        PlayerPrefs.SetInt("skinCount", getSkinCount);
        for (int i = 0; i < getSkinCount; i++)
        {

            mySkins.Add(skinObject.gameObject.name);    
            PlayerPrefs.SetString("skinCollections" + (getSkinCount -1), mySkins[i+(getSkinCount - 1)]);
        }
        getSkinCount++;

    }
    else
    {
        Debug.Log("first time buying");
        skinCount++;
        mySkins.Add(skinObject.gameObject.name);
        PlayerPrefs.SetInt("skinCount", skinCount);
        PlayerPrefs.SetString("skinCollections" + 0, mySkins[0]);

    }

    PlayerPrefs.Save();
}

I’m almost close to done. The problem left now is that my int i is set to 1 when there are no values. Please help. Anything is appreciated, Thanks in Advance,

Update: This still doesn’t work. Even if 1 session only since mySkins doesn’t have any values yet.

It is hard to understand exactly what you want to do with your code, but I can see some immediate flaws:

for (int i = 1; i < getSkinCount; i++)
 {
     mySkins.Add(skinObject.gameObject.name);
     PlayerPrefs.SetString("skinCollections" + (getSkinCount - 1), mySkins*);*

}
Why are you starting the iteration at i=1 and not 0? And also what you do in the loop is overwriting the value of string “skinCollections” + (getSkinCount - 1) which is constant throughout the looping with mySkins*.*

Why don’t you just use a dictionary with key skinIndex and value the skinName instead of indexing on the collection?