public void CreateObjects() { m_JobObjects = new List <JobObject>(); m_MachineObjects = new List <MachineObject>(); for (int y = 0; y < jsd.NumMachines; y++) { m_MachineObjects.Add(MachineObject.CreateComponent(m_MachineObjectRef, this, y)); Transform machine = m_MachineObjects[y].transform.Find("Machine").GetComponent <Transform>(); machine.position = machine.position + new Vector3(10, 0, UnityEngine.Random.Range(0, 200.0f)); } for (int j = 0; j < jsd.NumJobs; j++) { JobObject currentJob = JobObject.CreateComponent(m_JobObjectRef, this, j); for (int t = 0; t < jsd.NumMachines; t++) { int machineIndex = jsd.JobTaskMachines[j][t]; int duration = jsd.JobTaskDurations[j][t]; MachineObject currentMachine = m_MachineObjects[machineIndex]; currentJob.AddTask(currentMachine, duration); } m_JobObjects.Add(currentJob); currentJob = null; } }