Bo zaldowaniu sceny , tworzy folder ale nie ma w nim zadnego screenshota.Wyskakuje mi blad failed to store a screenshot , nie wiem czemu.Pomozecie?
using UnityEngine;
using System.Collections;
public class ScreenShotTaker : MonoBehaviour {
public bool lastScene = false;
string folderPath;
string fileName;
private static string persistentDataPath = null;
public string imie;
public string nazwisko;
public string klasa;
void Start () {
if (lastScene == true)
{
ScreenShot();
}
}
public void ScreenShot()
{
folderPath = System.IO.Directory.GetCurrentDirectory() + "\\" + folderPath;
if (persistentDataPath == null)
{
persistentDataPath = Application.persistentDataPath;
Debug.Log("Data Path = " + persistentDataPath); // If you want to easily see where that is.
}
Debug.Log("Screenshoted");
if (!System.IO.Directory.Exists(folderPath))// jezeli folder nie istnieje
{
System.IO.Directory.CreateDirectory(folderPath); //stworz nowy
}else
Application.CaptureScreenshot(folderPath);
fileName = "Screenshot__"+ imie + nazwisko + klasa + System.DateTime.Now.ToString("__yyyy-MM-dd") + ".png";
Debug.Log(fileName);
}
}