Created
May 22, 2017 16:26
-
-
Save kaiware007/9b78aa901183fb2a5e99ab76fe3ccee8 to your computer and use it in GitHub Desktop.
Vector3をファイルに保存する
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.IO; | |
using UnityEngine; | |
public static class Dump | |
{ | |
public static void DumpVector3(Vector3[] datas, string fileName) | |
{ | |
StreamWriter sw; | |
string date = System.DateTime.Now.ToString("yyyyMMddtthhmmss"); | |
string filePath = Application.dataPath + "/../" + fileName + "_" + date + ".txt"; | |
sw = new StreamWriter(filePath, false); //true=追記 false=上書き | |
for (int i = 0; i < datas.Length; i++) | |
{ | |
sw.WriteLine(i + "," + datas[i].x + "," + datas[i].y + "," + datas[i].z); | |
} | |
sw.Flush(); | |
sw.Close(); | |
Debug.Log("Dump " + filePath); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment