// Use this for initialization void Start() { problem = ProblemSoccer.Import(problemPath, trajPath); players = new List <MotionModelSoccer>(); spawnObjects(); VC = new VirtualConstructSoccer(problem.formationPositions, playerHeight, boundingMinX, boundingMaxX, boundingMinZ, boundingMaxZ); }
public static ProblemSoccer Import(string filePath, string trajectoryPath) { StreamReader reader = new StreamReader(filePath); string json = reader.ReadToEnd(); reader.Close(); reader = new StreamReader(trajectoryPath); string trajJson = reader.ReadToEnd(); reader.Close(); ProblemSoccer map = JsonUtility.FromJson <ProblemSoccer>(json); map.read_polygons(json); map.readTrajectory(trajJson); return(map); }