- Home /
How to clone an ArrayList?
I'm using the PlayerPrefsX.cs class (found here) to set a bool array in the registry of Windows. After the first time saving the game I need to change a specific element in the array.
This isn't possible with the PlayerPrefsX.cs class so I thought maybe I can clone an ArrayList to the PlayerPrefsX.cs class (PlayerPrefsX.SetBoolArray), but it doesn't work at all. Does somebody know how to clone an array? Or how to change a specific element in a PlayerPrefsX bool array?
Answer by Eric5h5 · Mar 12, 2012 at 11:50 AM
All you have to do is load the array, change the element you want, and re-save the array. (By the way, ArrayPrefs2 is better.)
I have struggled a lot with getting Arrays to work into Unity3D, but seems I missed one really important thing: using System; :) Thanks Eric5h5 for your answer, but fixed it already.
Your answer
Follow this Question
Related Questions
How to Clone Array1 into Array2 in Unity? Using JavaScript. 0 Answers
Component not being accessed in ArrayList 1 Answer
Gravitar /Thrust Clone 2 Answers
Why does instantiation of clone cause duplicates 1 Answer
Assign an instantiated GameObject? 1 Answer