- Home /
How to send/copy array from dictionary to class and further to list of class
Hi . I need a little bit help)) - I would array1 int[] , that allocate into dictionary, content of that array copy to array2 int[] (dimension identical, but without feedback). - and this array2 together others field of class STR to thrust in List of examples STR. 1. Array1 fill with help "foreach" MyDict. Debug.Log report me that ok, array1 not empty. 2. I have class STR:
public claas STR
public string b1;
public string b2;
public int[] units = new int[18]; // <--- массив2
public STR(string bb1, string bb2, int[] units)
{
this.b1 = bb1;
this.b2 = bb2;
Array.Copy(units, this.units, 18);
}
Other script have one method, that add example of claa STR to ListSTR. camp.listSTR.Add(new STR(bas1.name, base2.name, base2.MyDict[base1]));
base1, base2 - scripts. MyDict with array1 locate in to base2. BUT array2 all the same is empty. there null in array2 In inspertor. THOugh at the same time these two string variable as a result were added List. What I not so do, prompt please? ((
Your answer
Follow this Question
Related Questions
How to check if the string is on a text file 0 Answers
Detecting OnMouseDown from colliders in an array 1 Answer
Combine Children Dictionary in place of Hashtable? 2 Answers
How to make a or array of GUI.Button's? 1 Answer
Pick between two floats 2 Answers