Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#pragma strict
import System.IO;
function OnGUI()
if( GUI.Button(Rect(0, 0, 100, 100), "load") )
function Load()
var zipPath = Application.temporaryCachePath + "/";
var exportPath = Application.temporaryCachePath + "/unzip";
var imagePath = exportPath + "/twitter_icon.png";
var www = new WWW("");
yield www;
var data = www.bytes;
File.WriteAllBytes(zipPath, data);
ZipUtil.Unzip(zipPath, exportPath);
var tex = new Texture2D(1, 1);
var imageData = File.ReadAllBytes(imagePath);
GetComponent.<UnityEngine.UI.RawImage>().texture = tex;
Directory.Delete(exportPath, true);

This comment has been minimized.

Copy link
Owner Author

tsubaki commented May 11, 2015


  1. Open Sample.unity (
  2. download and import this script.
  3. Change component UnzipAndRead -> UnzipAndReadJS (UnzipAndRead is attached in Canvas/RawImage object)
  4. Play then download , unzip, and show image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.