Unity 2020 uses the MapBox plug-in to introduce satellite maps (including the new version of the Mapbox official website registration account)

1. Mapbox account registration

To use the Mapbox plug-in for unity, you first need to register an account on the official website, enter the official website and click sign up in the upper right corner to register, and fill in the user information. Mapbox official website link
insert image description here
After this step, you need to add credit card information. Since there are no resources in this area, I found a small tool to randomly generate a credit card account at that time. You can temporarily respond to emergencies, or you can directly use the information in the picture. Generate a random account.
insert image description here
After clicking get started, it will show that the submission failed. Don’t worry about it. After receiving the email, verify it to complete the registration. After successful registration, you can see the Access Token in the account information, which will be used later.
insert image description here

Two, Unity import

I am using the mapbox v2.1.1 version of the package here. If you need it, you can contact me directly, and I will give the corresponding link later.

It should be noted here that it may be that the mapbox update has not kept up, and AR-related packages are not compatible with unity2020 and above, so we only check the mapbox option to import.

insert image description here
After the import is successful, the error shown in the figure below will be reported, and the corresponding code segment will be found.
insert image description here
It can be solved by removing the comment of the heading variable declaration.
insert image description here
insert image description here
After the modification, the setup window will pop up. If there is no pop-up window, you can click mapbox->setup on the toolbar to set it yourself, copy the previous Access Token and submit it to use.
insert image description here

3. Set the satellite map

First create an empty game object named Map, and add the Abstract Map component to the Map object. In the Inspector view, you can set related properties as needed. In the IMAGE property, set the Data Source to Mapbox statellite to display the satellite map.
insert image description here

Realize the effect ↓
insert image description here

Guess you like

Origin blog.csdn.net/qq_44706002/article/details/126829451