Hi… I’m trying to get my array to get values from another array of the same type.
Here’s my code that works
public Skill[] allSkills;
void Start ()
{
allSkills = new Skill[5]; // this is a class of array
}
void GetArray ()
{
string blah = PlayerPrefs.GetString("CatSkills");
// if you don't know json, just think of the right side as another class of array
allSkills = JsonConvert.DeserializeObject<Skill[]>(blah);
// the above can also be translated as
Skill[] skill;
allSkills = skill;
}
While the above works, it only applies the values on allSkills[0]. And after I deleted my PlayerPrefs, it turns my allSkill’s array size to null.
How do I make it maintain my array size and apply the values to ‘allSkills[1]’?