Making a reset function for arrayed objects

Hi, i’m new at this but i’ll try to do my best:

I’ve got several arrays of transforms(8 arrays of 30, all instantiated from one prefab) which i modify with several function -moving their vertices, rotations, position, rendering, etc-.

i wanna make a RESET function in order to make all return to their original state (their state just after their initial instantiation). i tried to store the vertices original position, but without success,

Is there any way to say, go back to the prefab-just after cloned state?

// edit!
i dont wanna reset all at the same time, so i was trying to make a function(transform, array) and call it whenever i want.

thanks

 function reset (valor:Transform,grupo:Array)
 {  
for (valor in grupo)
	{	
	 var mesh = valor.GetComponent(MeshFilter).mesh;
	 var groupvertex = mesh.vertices;	
	 for (var i=0;i<groupvertex.Length;i++)
	{
	 Vector3.Lerp(Vector3(groupvertex<em>.x,groupvertex<em>.y,groupvertex<em>.z),Vector3(startPoint<em>.x,startPoint_.y,startPoint*.z), 1);*_</em></em></em></em>

* }*
}

What about creating two arrays at first and using only one. Then when trying to reset use the original one.

The point is your second array is not the same as the first one. Classes and their instantiations are passed by reference, meaning that you modify the object, the reference is modified as well.

var myArray = new GameObject[5];
var myStorage = new GameObject[5];  
for (var i:int =0;i<5;i++){
var go = Instantiate(parameters);
   myArray *= go;*

myStorage = go;
}
Both arrays refered to the same object so in the end myStorage is the same as myArray.
What you need is a simple container storing the values you want to keep.
You could create a class that holds the values and creates an array of that class.
class info{
var health:int;
var size:int;
var position:Vector3;
//…
}
var myArray = new GameObject[5];
var myStorage = new Info[5];
for (var i:int =0;i<5;i++){
var go = Instantiate(parameters);
myArray = go;
myStorage*.health = go.health;*
myStorage*.position = go.position;*
// …so on
}

function CrearOctogono (ancho:int,largo:int,a:int)
{
abajo = new GameObject [ancho,largo];
dchabajo = new GameObject [ancho,largo];
izqdabajo= new GameObject [ancho,largo];
izqd = new GameObject [ancho,largo];
dcha = new GameObject [ancho,largo];
dchaarriba= new GameObject [ancho,largo];
izqdarriba= new GameObject [ancho,largo];
arriba = new GameObject [ancho,largo];

for (var x = 0;x < ancho; x++) {
for (var z = 0;z < largo; z++)
    { 
    abajo[x,z]      =Instantiate (prefab, Vector3(x*a,0,z*a), Quaternion.identity); 
     dchabajo[x,z]  = Instantiate (prefab, Vector3(a/1.4142+a*2+x*a/1.4142,a/3+a*x/1.4142,z*a), Quaternion.Euler(0,0,45));
     izqdabajo[x,z]	= Instantiate (prefab, Vector3(-a/1.4142-x*a/1.4142,a/3+a*x/1.4142,z*a), Quaternion.Euler(0,0,-45));
     izqd[x,z]		= Instantiate (prefab, Vector3(-a*2/1.4142-a,a*3.5/1.4142+a*x,z*a), Quaternion.Euler(0,0,-90));
     dcha[x,z]		= Instantiate (prefab, Vector3(a*2/1.4142+3*a,a*3.5/1.4142+a*x,z*a), Quaternion.Euler(0,0,90));
     dchaarriba[x,z]	= Instantiate (prefab, Vector3(a/1.4142+a*2+x*a/1.4142,a*2+a*6.5/1.4142-a*x/1.4142,z*a), Quaternion.Euler(0,0,135));
     izqdarriba[x,z]	= Instantiate (prefab, Vector3(-a/1.4142-x*a/1.4142,a*2+a*6.5/1.4142-a*x/1.4142,z*a), Quaternion.Euler(0,0,-135));
     arriba[x,z]		= Instantiate (prefab, Vector3(x*a,a*2+a*7/1.4142,z*a), Quaternion.identity.Euler(0,0,180));