- Home /
Question by
Nick_Rizzo · Sep 27, 2016 at 01:59 AM ·
c#editorruntime.net
StreamWriter issue c#
So to save info about a level I am using StreamWriter. It works in the editor but not after being built.
public void save() {
StreamWriter writer = new StreamWriter(ProjectLocation + "\\" + "Main.txt");
for (int i = 0; i < basicObjects.Count; i++)
{
Debug.Log(basicObjects[i].transform.rotation.x + " " + basicObjects[i].transform.rotation.y + " " + basicObjects[i].transform.rotation.z);
Debug.Log(basicObjects[i].name + System.Environment.NewLine
+ basicObjects[i].transform.position.x + System.Environment.NewLine + basicObjects[i].transform.position.y
+ System.Environment.NewLine + basicObjects[i].transform.position.z + System.Environment.NewLine + basicObjects[i].transform.rotation.eulerAngles.x + System.Environment.NewLine + basicObjects[i].transform.rotation.eulerAngles.y + System.Environment.NewLine + basicObjects[i].transform.rotation.eulerAngles.z + System.Environment.NewLine);
writer.WriteLine(basicObjects[i].name + System.Environment.NewLine
+ basicObjects[i].transform.position.x + System.Environment.NewLine + basicObjects[i].transform.position.y
+ System.Environment.NewLine + basicObjects[i].transform.position.z + System.Environment.NewLine + basicObjects[i].transform.rotation.eulerAngles.x + System.Environment.NewLine + basicObjects[i].transform.rotation.eulerAngles.y + System.Environment.NewLine + basicObjects[i].transform.rotation.eulerAngles.z + System.Environment.NewLine + basicObjects[i].transform.localScale.x + System.Environment.NewLine + basicObjects[i].transform.localScale.y + System.Environment.NewLine + basicObjects[i].transform.localScale.z);
}
writer.WriteLine(moneytoleave.text);
writer.Close();
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612093538im_/https://answers.unity.com/themes/thub/images/avi.jpg)