Question by
benjamin.cheung · Feb 16, 2016 at 01:04 PM ·
androidunity 5savingscreenshotcs
How to save screenshots to com.company.product folder?
I have the below C# code executing upon clicking a button on an android device. I have no idea why it's not saving. Am I missing some code?
using UnityEngine;
using System.Collections;
public class ScreenShot : MonoBehaviour
{
public static string ScreenShotName(string testbed)
{
return string.Format("{0}/Screenshot/{1}-{2}.png", Application.persistentDataPath, testbed, System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"));
}
public void OnClickSaveImage()
{
string name = ScreenShotName("test");
Application.CaptureScreenshot(name);
}
}
Comment
Answer by S-arman · Dec 23, 2018 at 04:28 PM
I can help you but my variant is working only in editor and I dont know why. Need code?
Your answer
Follow this Question
Related Questions
Android persistentdatapath Can be read but not written. 0 Answers
Unity Remote 5 Not Connecting 3 Answers
Gradle Install not Valid Unity 2020.2.3 0 Answers
NullReferenceException (Updated) 1 Answer
[AdMob][Android] Re-Packing error 0 Answers