Fix frame capturing path
This commit is contained in:
parent
4a6bdf0e96
commit
7cea4cd4e8
@ -7,7 +7,7 @@ using UnityEngine;
|
||||
public class Main : MonoBehaviour
|
||||
{
|
||||
#region Constants
|
||||
readonly string capturedFramesPath = Path.Combine(Application.dataPath, "..", "..", "capturedframe");
|
||||
string capturedFramesPath = Path.Combine(Application.dataPath, "..", "..", "Trees");
|
||||
#endregion
|
||||
|
||||
#region Camera GUI fields
|
||||
@ -141,6 +141,8 @@ public class Main : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
capturedFramesPath = Path.Combine(capturedFramesPath, tree1.name);
|
||||
|
||||
bool exists = Directory.Exists(capturedFramesPath);
|
||||
if (!exists) Directory.CreateDirectory(capturedFramesPath);
|
||||
|
||||
@ -348,7 +350,7 @@ public class Main : MonoBehaviour
|
||||
RenderTexture.active = currentRT;
|
||||
++FrameCounter;
|
||||
|
||||
string path = Path.Combine(capturedFramesPath, tree1.name + "-" + FrameCounter.ToString() + ".png");
|
||||
string path = Path.Combine(capturedFramesPath, FrameCounter.ToString() + ".png");
|
||||
byte[] bytes = offscreenTexture.EncodeToPNG();
|
||||
File.WriteAllBytes(path, bytes);
|
||||
Debug.Log(path);
|
||||
|
Loading…
Reference in New Issue
Block a user