Skip to content

Instantly share code, notes, and snippets.

@ginxx009
Last active December 14, 2017 05:03
Show Gist options
  • Save ginxx009/705184ceaa94156cdb647fff2621ae02 to your computer and use it in GitHub Desktop.
Save ginxx009/705184ceaa94156cdb647fff2621ae02 to your computer and use it in GitHub Desktop.
//ANDROID PLATFORM
string json = null;
string full_path = Application.streamingAssetsPath + "filename";
// Android only use WWW to read file
WWW reader = new WWW(full_path);
//wait until the download is done
while (!reader.isDone){}
json = reader.text;
//STANDLONE PLATFORM
string json = null;
string full_path = Application.streamingAssetsPath + "filename";
StreamReader reader = new StreamReader(full_path);
json = reader.ReadToEnd().Trim();
reader.Close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment