Created
November 1, 2017 20:24
-
-
Save phoenixperry/1ca588c972694554d079aa9d5f0ed79f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System.IO; | |
public class FileWriting : MonoBehaviour { | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update() | |
{ | |
Vector3 position = new Vector3(Random.Range(-10.0f, 10.0f), 0, Random.Range(-10.0f, 10.0f)); | |
this.transform.localScale = position; | |
WriteString(position); | |
} | |
StreamWriter writer; | |
string path = "Assets/Resources/test.txt"; | |
void WriteString(Vector3 pos_) | |
{ | |
//Write some text to the test.txt file | |
writer = new StreamWriter(path, true); | |
writer.WriteLine("Test" + pos_.ToString()); | |
writer.Close(); | |
writer.Dispose(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment