UNITY,保存图片到安卓本地后,刷新安卓本地图库
// Update is called once per frame
//刷新图片,显示到相册中
//图片地址 精确到图片名称和类型. 如: ../image1.png
void photo_update(string[] path)
{
using (AndroidJavaClass PlayerActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
{
AndroidJavaObject playerActivity = PlayerActivity.GetStatic<AndroidJavaObject>("currentActivity");
using (AndroidJavaObject Conn = new AndroidJavaObject("android.media.MediaScannerConnection", playerActivity, null))
{
Conn.CallStatic("scanFile", playerActivity, path, null, null);
log_标签.text += "刷新本地相册!地址是:"+ path[0];
}
}
}