Ya postee algo parecido, pero no encuentro el post. Llevo buscando esto un par de horas y me he rendido. Quiero sacar una screenshot en android y encuentro muchos post, webs tutoriales todo que te enseñan pero ami no me deja. mi script es un botón que ejecuta:Application.CaptureScreenshot(Application.persistentDataPath+"/prueba.jpg"); Tengo el Write Acess en la SD pero aun así nada. En el pc me va bien. He probado ya haciendo directorios con System.IO y me crea las carpetas pero nunca me crea la imagen.
yo use este y me sirvio
#pragma strict
var creatingFile : boolean = false;
var fileName :String = "Screenshot.png";
function Update() {
if(Input.GetMouseButtonDown(0)) {
Application.CaptureScreenshot(fileName);
creatingFile = true;
}
if (creatingFile) {
var origin : String = System.IO.Path.Combine(Application.persistentDataPath, fileName);
var destination : String = "/sdcard/ScreenCapture/" + fileName; // could be anything
if (System.IO.File.Exists(origin)) {
System.IO.File.Move(origin, destination);
creatingFile = false;
}
}
}
[quote author=jeico008" data-ipsquote-contapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentclass="forums_Topic" data-ipsquote-contentid="28218" data-ipsquote-contentcommentid="115678">yo use este y me sirvio
#pragmavar creatingFile : boolean = false;
var fileName :String = "Screenshot.png";
function Update() {
if(Input.GetMouseButtonDown(0)) {
Application.CaptureScreenshot(fileName);
creatingFile = true;
}
if (creatingFile) {
var origin : String = System.IO.Path.Combine(Application.persistentDataPath, fileName);
var destination : String = "/sdcard/ScreenCapture/" + fileName; // could be anything
if (System.IO.File.Exists(origin)) {
System.IO.File.Move(origin, destination);
creatingFile = false;
}
}
}
[/quote]Gracias, yo al final me descargué un plugin de la asset store... Soy tonto jajaja. Te aconsejo el plugin, es gratis y tiene muchísimas opciones.
https://www.assetstore.unity3d.com/en/#!/content/43374 por cierto, tengo un problemita más, la cosa es que me guarda las imágenes pero no me salen en la galería del móvil. Ni poniendo las imágenes en DCIM. Solo me salen en la galería cuando elimino la app, ¿sabes por qué?