public void Load() { if (!File.Exists(absolutePath)) { Debug.LogError("Path/File doesn't exist"); return; } char[] delimiter = { ',' }; StreamReader sr = new StreamReader(absolutePath); audS.PlayOneShot(loadClip); so.reset(); os.DestroyAll(); string line = sr.ReadLine(); while (line != null) { string[] args = line.Split(delimiter); if (args.Length != 7) { Debug.LogError("File Parse Error, Incorrect Length, expected:7, actual:" + args.Length); return; } string objType = args[0]; Vector3 pos = new Vector3(float.Parse(args[1]), float.Parse(args[2]), float.Parse(args[3])); Quaternion rotation = Quaternion.Euler(float.Parse(args[4]), float.Parse(args[5]), float.Parse(args[6])); ObjectSpawner.Instance.Spawn(objType, pos, rotation); line = sr.ReadLine(); } }