mapbox / mapbox-sdk-cs

C# libraries for Mapbox API layer
https://mapbox.github.io/mapbox-sdk-cs/
Other
20 stars 11 forks source link

Create a new implementation of IFileSource for use in the unity editor #36

Closed david-rhodes closed 7 years ago

david-rhodes commented 7 years ago

This would only need to work in the editor. Unity does not support coroutines at edit time, so UnityWebRequest and WWW both fail for the purposes of writing editor tools (geocoding, for example).

@BergWerkGIS I know you said you tested System.web but it didn't work on mobile. Does it work in the editor?

wilhelmberg commented 7 years ago

Tried WebClient and it worked.

david-rhodes commented 7 years ago

@BergWerkGIS Have that class somewhere? I want to use this in the SDK for the Geocode attribute.

wilhelmberg commented 7 years ago

Sorry, no class, just put a quick test field into SlippyEditor.cs. And called out to something like

using(WebClient wc = new WebClient()){
   resultTestField.StringValue = wc.DownloadString("http://www.mapbox.com").Substring(10);
}

One annoyance I noticed: OnInspectorGUI() seems to fire quite often, after each key press. For geocoding we might want to add a delay there, eg only send request after there has been no key press for at least 500ms.

david-rhodes commented 7 years ago

Linked.