I’m trying to kill two birds with one stone. I have a function that assigns attribute variables from PlayerPrefs and adds them to an arraylist. The compiler wants a data type to return, but using arraylist isn’t working. What should I use?
ArrayList LoadAttributes(){
ArrayList myAttributes =new ArrayList();
myAttributes.Add(Constitution=PlayerPrefs.GetInt(“Constitution”,_constitution));
myAttributes.Add(Strength=PlayerPrefs.GetInt(“Strength”, _strength));
myAttributes.Add(Stamina=PlayerPrefs.GetInt(“Stamina:”, _stamina));
myAttributes.Add(Dexterity=PlayerPrefs.GetInt(“Dexterity:”, _dexterity));
myAttributes.Add(Intelligence=PlayerPrefs.GetInt(“Intelligence:”, _intelligence));
myAttributes.Add(Wisdom=PlayerPrefs.GetInt(“Wisdom:”,_wisdom));
myAttributes.Add(Focus=PlayerPrefs.GetInt(“Focus:”,_focus));
myAttributes.Add(Speed=PlayerPrefs.GetFloat(“Speed:”, _speed));
return myAttributes();
Thanks!