private void Start() { AirTrafficPath p = Paths[GetPathIndex("60")]; int c = p.AtomsAsBase.Count; for (int i = 0; i < c; i += 2) { p.specialRadii.Add(i, 0.3f); } InitializeRendering(); startTime = Time.time; }
protected override bool LoadFromCSV(string filename) { districtSize = new Vector3(15, 15, 15); TextAsset file = Resources.Load <TextAsset>(filename); if (file == null) { return(false); } Paths = new List <AirTrafficPath>(); Dictionary <string, AirTrafficPath> PathsDict = new Dictionary <string, AirTrafficPath>(); string[] rawData = file.text.Split(new char[] { '\n' }); foreach (string row in rawData) { string[] words = CsvSplit(row, ','); //Selon configuration de l'OS, mettre ',' ou '.' if (words.Length < 2) { continue; } AirTrafficPath p; if (!PathsDict.TryGetValue(words[0], out p)) { p = new AirTrafficPath() { ID = words[0] }; Paths.Add(p); PathsDict.Add(p.ID, p); } AirTrafficAtom a = new AirTrafficAtom { time = InterpretTime(words[1]), point = new Vector3(float.Parse(words[2]), float.Parse(words[4]), float.Parse(words[3])), path = p, indexInPath = p.atoms.Count }; p.atoms.Add(a); } return(true); }