Setting up the Google Places API service
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
:
- Go back to the Unity editor. Drag the Map scene into the Hierarchy window from the
Assets
folder in the Project window. - Expand the
MapScene
andServices
object in the Hierarchy window. - Right-click (press
Ctrl
and click on a Mac) on the
Services
object, and from the context menu select Create Empty. Rename the new objectGooglePlacesAPI
. - Drag the
GooglePlacesAPIService
script from theAssets/FoodyGo/Scripts/Services
folder and drop it onto theGooglePlacesAPI
object in the Hierarchy or Inspector windows. - Right-click (press
Ctrl
and click on a Mac) on the
MapScene
object in the Hierarchy window, and from the context menu select Create Empty. Rename the new objectPlaceMarker
. - Right-click (press
Ctrl
and click on Mac) on the
PlaceMarker
object in the Hierarchy window...