[System.Serializable]
public class allwc {
int dx = 2;
List<wc> lst;
public allwc(List<GameObject> allworker) {
List<wc> lst = new List<wc>();
for (int i = 0; i < allworker.Count; i++) {
wc wcone = new wc();
wcone.x = allworker[i].transform.position.x;
wcone.y = allworker[i].transform.position.y;
wcone.food = allworker[i].GetComponent<worker1>().food;
wcone.mas = new int[3];
wcone.mas[0] = 22;
wcone.mas[1] = 33;
wcone.mas[2] = 44;
lst.Add(wcone);
}
}
public List<wc> getallwc() {
return lst;
}
public int getdx()
{
return dx;
}
}
public void savegame() {
print("save");
allwc allwcOne = new allwc(allworker);
List<wc> lst = new List<wc>();
lst = allwcOne.getallwc();
print(allwcOne.getallwc()[0].x);
}
print(allwcOne.getallwc()[0].x) - в чем ошибка почему он не может его найти ?