Closed GafferSystems closed 6 years ago
@gkngkc Any news on this? Seems to be broken for mac on newer versions of Unity all together.
Hi,
If i understand correctly, you're running editor with mac build settings on a windows machine. If this is the case, it won't work because of the plugin selection code. You can use EDITOR compile flags to select correct plugin.
Hi again @gkngkc ! We have now ran it on a Mac, standalone outside the editor, and it's still not working, we get a different error message here though.
When we request to open file dialog it opens as expected. It let's us select a png or jpg, but when we try to use it, it spins for a while and return an error, followed by closing without returning the selected image.
Here is my code that works for Win but not Mac:
public void uploadImage() { paths = StandaloneFileBrowser.OpenFilePanel("Choose image", "", "", false); WWW www = new WWW ("File://" + paths[0]); imagePlane.GetComponent<Renderer> ().material.mainTexture = www.texture; }
It's probably because of WWW. You can check these two things,
@gkngkc I tried once again on windows and mac. On Windows it works perfectly, and the path[0] returns: "C:\Users\Myname\Desktop\image.png
On mac it crashes with the UriFormatException, and path[0] returns: file:///Users/Myname/Desktop/image.png
Seems like adding file:// to the www was the issue, it works for windows but not mac if its' added. Removing it from the line, so it becomes WWW www = new WWW (paths[0]);
Fixes everything. Thanks for your time @gkngkc and hope this can help others encountering the same issue.
Unity 2017.1.1f1
Got: DllNotFoundException: StandaloneFileBrowser![error log](https://user-images.githubusercontent.com/32983453/33715874-5c98322e-db54-11e7-81d0-7508944296d9.png)