mapbox / mapbox-sdk-cs

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

In Response.cs the #if UNITY_EDITOR || UNITY_STANDALONE || UNITY_ANDROID || UNITY_WP_8_1 || UNITY_WSA || UNITY_WEBGL || UNITY_IOS || UNITY_PS4 || UNITY_SAMSUNGTV || UNITY_XBOXONE || UNITY_TIZEN || UNITY_TVOS #define UNITY #endif can' t work #79

Closed veyvin closed 7 years ago

veyvin commented 7 years ago

when I Compile the Mapbox.platform.dll and in unity, I Decompile the dll, I found that the #if UNITY miss, because that unity have no Conditional compilation #if UNITY

wilhelmberg commented 7 years ago

when I Compile the Mapbox.platform.dll and in unity, I Decompile the dll

@veyvin Is there any specific reason why you want to include the DLLs instead of the source files?

The workflow is currently setup to use source files only in mapbox-unity-sdk.

Our custom define UNITY is defined at the top of Response.cs: https://github.com/mapbox/mapbox-sdk-cs/blob/master/src/Platform/Response.cs#L8

Of course that get's lost when you compile (in Visual/Xamarin Studio) and then decompile the DLL (Unity). As you are building the DLL with Visual or Xamarin Studio the are no Unity specific defines available at that time and the Unity specific code is not included in the DLL.

david-rhodes commented 7 years ago

@veyvin You could try defining UNITY in the project player settings:

screen shot 2017-05-15 at 9 20 17 am

Otherwise, as @BergWerkGIS mentioned, we recommend using source files.

veyvin commented 7 years ago

@david-rhodes @BergWerkGIS thanks, I try to define UNITY in player settings, but it also an error, I using the source files, it's fine.