wrld3d / unity-api

Issue tracking for the WRLD Unity SDK
28 stars 8 forks source link

New default lat/long #117

Closed hannahaponenko closed 2 years ago

hannahaponenko commented 2 years ago

Description

Hello! I'm trying to replicate the search option of the web-based WRLD map but in Unity. Trying to reverse engineer this, but am total noob. Wondering if there were any tips as to which C# scripts I should be looking at? I tried changing the config params to look at Toronto instead of San Fran but can't get the map to update even after updating lat long in that file or the wrldmap.cs file.

Steps to Reproduce

  1. Visit ConfigParams.cs and WrldMap.cs files
  2. Change lines 214 and 215 in ConfigParam.cs to reflect new lat long values (or lines 22 and 27 in WrldMap,cs) Latitude: 43.6777; Longitude: -79.6248
  3. Compile and run UnityWorldSpace scene in Unity

Expected behavior: I expect to be atop of Toronto Pearson Airport

Actual behavior: I'm still stuck in San Fran

Reproduces how often: 100%

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue, e.g.:

chrisdjali-wrld3d commented 2 years ago

If you've added a WrldMap MonoBehaviour to a game object, then it starts off centred on the lat long specified in the inspector GUI. Changing the value in WrldMap.cs only affects the default value in the GUI for newly-added map objects, not for ones you've already got. Changing the value in ConfigParams.cs won't have any effect if you're using the default WrldMap MonoBehaviour instead of a custom one as WrldMap sets the value based on its member variables (controlled via the inspector GUI) when initialising the map.

Basically, you need to set the desired starting lat long in the inspector GUI or the scene's .unity file.