Search Unity

Save Array Data to Playerprefs

Discussion in 'Editor & General Support' started by StathisGamer, Feb 15, 2020.

  1. StathisGamer

    StathisGamer

    Joined:
    Oct 16, 2019
    Posts:
    13
    I have this problem: I have a 3d Array and i want all the data it has to be saved. i have tried to use playerprefs with no success. If you know how i can do that please tell me down bellow.

    My code:
    // the Array i have
    public int[,,] StatsArray = new int[3000,13,6];

    and i tried to save it like this
    PlayerPrefs.SetInt("Stats",44) = StatsArray[44, 2, 5] ;
    but it gives me errors.
    also instead of 44, 2, 5 i want to have valuables.
    Thanks in advance