- Home /
Copy/Paste an entire array during run time to use it later ?
Hi, this is my first question I'm kind of a newbee in Unity and I'll start by saying a big THANK YOU to the community here for all the helps it has already given me !
So I'm parsing that huge array (length : 1 million) I get with a GetPixels32 on a big texture that will always be the same during the game. I'm parsing it to get only all the pixels that, let's say, are blue. The results is a rather small array (length : 400).
As this parsing is taking a lot of CPU at the beginning of the game, it would be better if I could start with the small array from the beginning.
I know how to do a print/debug of an array in the console, but the result is not handy to copy/past.
Is there some kind of way to grab that entire array (in one copy/past) to write it down in my code ?
Okay, it was super-easy ....
I just had to add that in my for loop parsing the huge array (with int i) :
mystring = mystring +"ArrayName["+i+"] = new Vector2("+myvalueX+","+myvalueY+");";
then, launch a debug.Log(mystring) to get all the array copy/pastable in the console.
Your answer

Follow this Question
Related Questions
Move one of the objects selected from array ? 1 Answer
Array Out Of Range: Jibe 0 Answers
C# Debug 3D Array 2 Answers
Copy/Paste entire array in inspector? 1 Answer
PropertyDrawer Copy Paste values from array of structs 1 Answer