- Home /
StreamingAssets with OSX
Hello,
Something very strange is happening to me. I am creating an OSX app, building the player and then executing it on the MAC. Everything works fine: I can see all the Streaming Assets (some textures). However when I create a .pkg of this .app and install it as an Application, I execute it and the Streaming Assets are not being found. I activated the Logs and what I get is this error: Couldn't open file /Applications/MyApp.app/Contents/Data/StreamingAssets/Subfolder/MyTexture.png. The path is perfectly well so I do not get why is this not working. The code related to this is the following:
string sFinalPath = "file://" + Application.streamingAssetsPath + "/" + sTexturePath + sTextureName + ".png";
m_WWWLoader = new WWW(sFinalPath);
yield return m_WWWLoader;
if (m_WWWLoader.isDone)
{
Debug.Log("============> Loader done with error (" + m_WWWLoader.error + ")");
}
If anyone knows what is going on please tell me :)
Thanks in advance!
@Graham Dunnet: That's the only thing I can think about..... but then must be some explanation somewhere :O
Answer by Barbur01 · May 15, 2013 at 09:49 PM
[SOLVED] I resolved this using Resources.Load instead of WWW.
Answer by qoobit · Dec 04, 2015 at 10:46 AM
For OSX it's actually listed under .app/Contents/Data/Resources/StreamingAssets/ Not sure when Unity is going to fix that.