前提・実現したいこと
Rotation と Positionをログとしてファイルに残したいのですができません。
発生している問題・エラーメッセージ
DirectoryNotFoundException: Could not find a part of the path Failed to issue albedo update.
該当のソースコード
c++
試したこと
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
public class HDMLog : MonoBehaviour
{
// Use this for initialization void Start() { } // Update is called once per frame void Update() { double xP, yP, zP, xR, yR, zR; StreamWriter sw; FileInfo fi; fi = new FileInfo(Application.dataPath + "Log/HMDLog/Coordinate00.csv"); sw = fi.AppendText(); if (Input.GetKey(KeyCode.Space)) { sw.WriteLine("SpaceKey"); } xP = this.transform.position.x; yP = this.transform.position.y; zP = this.transform.position.z; xR = this.transform.eulerAngles.x; yR = this.transform.eulerAngles.y; zR = this.transform.eulerAngles.z; sw.WriteLine(xP + "," + yP + "," + zP + "," + xR + "," + yR + "," + zR); sw.Flush(); sw.Close(); }
}
このコードで試しているのですができません。
先輩のコードなのですがそのままではエラーが生じてしまいます。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
質問と関係ないですが、コードはバッククォート3つ同士で囲むと整形されて見やすくなります。回答する側も見るコストが下がるので、質問する際は整形するようにお願いします。
```
float a = 1.0f;
```
↑こんな感じです。

回答2件
あなたの回答
tips
プレビュー