private bool WriteDataToJPG(Texture2D texture, SScreenShotImgInfo imgInfo, string filePath) { if (filePath == "") { return(false); } //类型byte数组 byte[] typeBytes = ImageExtensions.StructToBytes(imgInfo); //压缩Jpg文件Byte数组 byte[] imgBytes = texture.EncodeToJPG(); ImageExtensions.AppendDataToJPG(filePath, imgBytes, typeBytes); return(true); }