I get a photo from the phone camera and paste it into the frame (UI Image). If you left the application and came back again, you need to save the picture. To save using Asset Easy Save.
Code to save:
public void OnApplicationQuit() { im1 = GameObject.FindGameObjectsWithTag("um1"); for (int i = 0; i < im1.Length; i++) { ES2.SaveImage(im1[i].GetComponent<Image>().sprite.texture, "fileDirectory" + i + ".png"); } } Download Code:
void Start() { fileDirectory = Application.persistentDataPath; if (Directory.Exists("fileDirectory")) { im1 = GameObject.FindGameObjectsWithTag("um1"); for (int i = 0; i < im1.Length; i++) { Texture2D tyuio = ES2.LoadImage("fileDirectory" + i + ".png"); Sprite imga = SpriteFromTex2D(tyuio); im1[i].GetComponent<Image>().sprite = imga; } } Everything works under Windows, but not under Android, what could be the problem?