Hello,
I'm building a local save/load system for textures for iOS, and I'm working with both .NET and WWW systems. My WWW system doesn't seem to work for **loading** on iOS. Both work fine in the Editor.
.NET (Works):
var pathtype = GetDataPath();
var path = pathtype + "/" + dir;
var filepath = path + "/" + filename;
var imgRaw = File.ReadAllBytes(filepath);
var img = new Texture2D(size.x, size.y);
img.LoadImage(imgRaw);
WWW (Doesn't Work):
var pathtype = GetDataPath();
var path = pathtype + "/" + dir;
var filepath = "file://" + path + "/" + filename;
var www = new WWW(filepath);
var img = www.texture;
GetDataPath() basically just passes in the *persistentDataPath* or just a normal *dataPath* depending if I'm running it on iOS or in the Editor.
My debugger says it has been loaded, and the directory looks okay to me:
.NET (Works):
> /var/mobile/Containers/Data/Application/***/Documents/my_dir/profile.png
WWW (Doesn't Work):
> file:///var/mobile/Containers/Data/Application/***/Documents/my_dir/profile.png
↧