Since we have already imported the updated scripts, setting up this new service should be a breeze for us now. Perform the following instructions to set up and test the GooglePlacesAPIService
:
Assets
folder in the Project window.MapScene
and Services
object in the Hierarchy window.Services
object, and from the context menu select Create Empty. Rename the new object GooglePlacesAPI
.GooglePlacesAPIService
script from the Assets/FoodyGo/Scripts/Services
folder and drop it onto the GooglePlacesAPI
object in the Hierarchy or Inspector windows.MapScene
object in the Hierarchy window, and from the context menu select Create Empty. Rename the new object PlaceMarker
.PlaceMarker
object in the Hierarchy window, and from the context menu select 3D Object | Cylinder.PlaceMarker
object into the Assets/FoodyGo/Prefabs
folder to make it a new prefab. Leave the original object in the scene but deactivate it by unchecking the checkbox beside the objects name in the Inspector window.GooglePlacesAPI
object. Drag the PlaceMarker
prefab you just created onto the empty slot for the Place Marker Prefab slot.
GooglePlacesAPI
object still selected, fill in the properties, as shown in the following screenshot:
Google Places API Service configuration
If you are not using the Google coordinates in your GPS simulation and not seeing any locations, ensure that you try a location close to lots of restaurants, grocery stores, or any other place related to food. Of course, if you continue to experience troubles, refer to Chapter 10, Troubleshooting.
With the places service running, the player can now see new objects around them. We won't allow the player to interact with those objects, yet. However, we certainly don't want a plain old cylinder representing those markers either. What we need to do is create a much better-looking marker, and we will do that in the next section.
18.118.126.241