備忘録

Unity StreamingAssetsからファイルを読み出す

backham
Streaming Assets で iOSとAndroidの違いにハマったのでメモ。 string FilePath; #if UNITY_IPHONE FilePath = Application.dataPath + "/Raw/" + filename; #else string fullPath = "jar:file://" + Application.dataPath + "/!/assets/" + filename; WWW www = new WWW (fullPath); while (!www.isDone) { } FilePath = Application.persistentDataPath + filename; File.WriteAllBytes (toPath,www.bytes); #endif iOS