MS Bing์ ์ง๋๋ ํ๋์ Object ์์ ๋งต ๋ฐ์ดํฐ๋ฅผ ๊ทธ๋ฆฌ๋ ๋ฐฉ์์ด๋ค. ์ค์ฌ ์ขํ๋ฅผ ๋ฐ๊ฟ ๋๋ง๋ค Shader๋ก ์ง๋๋ฅผ ๊ทธ๋ฆฐ๋ค.
Mapbox๋ ์ฌ๋ฌ ๊ฐ์ Tile Object๋ฅผ ์์ฑํ๋ ๋ฐฉ์์ด๋ค. ์ค์ฌ ์ขํ๋ ๋งต ํฌ๊ธฐ๋ฅผ ๋ฐ๊พธ๋ฉด ํ์ผ ๋ฐ์ดํฐ๋ฅผ ์๋กญ๊ฒ ์์ฑํ๋ค.
๋งต์ ๊ฐ์ ธ์ค๋ ๋ฐฉ์์ ๋ฐ๊ฟ ์ ์๋ ์ง๋ ํ์ธ์ ์ ํด๋ดค๋๋ฐ, ์ผ๋จ ๊ธฐ๋ณธ์ ์ผ๋ก ์์ ๊ฐ์ด ๊ฐ์ ธ์จ๋ค.
ํ๋ก์ ํธ์๋ Mapbox ๋ฐฉ์์ด ์ ํฉํ์ฌ ์ด๊ฑธ๋ก ๋ณ๊ฒฝํจ.
์ค์น ๋ฐฉ๋ฒ
Install the Maps SDK for Unity
Add the Maps SDK for Unity dependency and required configuration to your app
www.mapbox.com
1. Mapbox SDK Importํ๊ธฐ
ERROR
AR ๊ด๋ จ Namespace๋ฅผ ์ฐพ์ง ๋ชปํ๋ ๋ฌธ์
1. SpatialTracking
Assets\GoogleARCore\SDK\InstantPreview\Scripts\InstantPreviewManager.cs(32,23): error CS0234: The type or namespace name 'SpatialTracking' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
-> AR Foundation ํจํค์ง ์ค์นํ๊ธฐ

2. ARBackgroundRenderer
Assets\UnityARInterface\Scripts\ARCoreInterface.cs(51,17): error CS0246: The type or namespace name 'ARBackgroundRenderer' could not be found (are you missing a using directive or an assembly reference?)
Assets\UnityARInterface\ARRemote\Scripts\ARRemoteEditorInterface.cs(40,17): error CS0246: The type or namespace name 'ARBackgroundRenderer' could not be found (are you missing a using directive or an assembly reference?)
Assets\UnityARInterface\Scripts\ARKitInterface.cs(26,17): error CS0246: The type or namespace name 'ARBackgroundRenderer' could not be found (are you missing a using directive or an assembly reference?)
Assets\GoogleARCore\SDK\Scripts\ARCoreBackgroundRenderer.cs(43,17): error CS0246: The type or namespace name 'ARBackgroundRenderer' could not be found (are you missing a using directive or an assembly reference?)

UnityARInterface์ GoogleARCore์ ๊ด๋ จ๋ ์๋ฌ๊ฐ ๋ฌ๋ค. AR์ ์ฌ์ฉํ์ง ์๊ณ ๋งต๋ง ์ฌ์ฉํ๊ณ ์ ํ๋ค๋ฉด Package Import ์ Mapbox๋ง ๋ฐ์ผ๋ฉด ๋๊ธฐ ๋๋ฌธ์ ๊ตณ์ด ์ ๊ฒฝ ์ฐ์ง ์์๋ ๋๊ธด ํจ
AR ๊ด๋ จ ํด๋์ค๋ฅผ ์ฐพ์ง ๋ชปํด์ ๋ฐ์ํ๋ ์๋ฌ์ธ๋ฐ, ๊ตฌ๊ธ๋งํ ๊ฒฐ๊ณผ Unity ๋ฒ์ ์ ๋ฐ๋ฅธ ํจํค์ง/๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ข ์์ฑ ๋ณ๊ฒฝ์ Mapbox๊ฐ ๋ฐ์ํ์ง ์์ ํ์ด๋ค. ์ฐธ๊ณ (Mapbox-Github-Issue) ๊ผญ ์ฌ์ฉํ๊ณ ์ถ๋ค๋ฉด Unity Editor๋ฅผ 2018 ํน์ ๊ทธ ์ดํ๋ก ๋ค์ด๊ทธ๋ ์ด๋ํ๊ณ ๊ด๋ จ ํจํค์ง ๋ฒ์ ์ ์ด๋ฆฌ์ ๋ฆฌ ์กฐ์ ํ๋ ๋ฐฉ๋ฒ๋ฐ์ ์๋ ๋ฏํ๋ค.

DeviceLocationProvider.cs์ UTF-8 ์ธ์ฝ๋ฉ ๋ฌธ์
Assets\Mapbox\Unity\Location\DeviceLocationProvider.cs(321,12): error CS0103: The name 'heading' does not exist in the current context
DeviceLocationProvider.cs ์คํฌ๋ฆฝํธ ํ์ผ ๋ด ์ธ์ฝ๋ฉ ๋ฌธ์ ๋ก ์๋์ ๊ฐ์ด ° ๊ธฐํธ๊ฐ ๊นจ์ ธ์ ์๊ธฐ๋ ๋ฌธ์ ์ด๋ค.
//fix heading to have 0๏ฟฝ for north, 90๏ฟฝ for east, 180๏ฟฝ for south and 270๏ฟฝ for west
๊นจ์ง ๋ ์๋ค์ ๋ชจ๋ ์ฐพ์์ ์ง์์ฃผ๋ฉด ๋๋๋ฐ ๊ท์ฐฎ์ผ๋ฉด ์ฌ๊ธฐ์ ์๋ ์ฝ๋๋ฅผ DeviceLocationProviders.cs์ ๊ทธ๋ฅ ๋ถ์ฌ ๋ฃ์ด๋ ๋จ.
2. ํ ํฐ ์ค์ ํ๊ธฐ
Import๊ฐ ์ ๋๋ก ๋์๋ค๋ฉด, ์๋ํฐ์ Mapbox๋ฉ๋ด๊ฐ ์์ฑ๋๊ณ Setup ์ค์ ์ฐฝ์ด ์ด๋ฆฐ๋ค.
Mapbox์ ๊ฐ์ ํ์ฌ ๋ฐ๊ธ๋ฐ์ ํ ํฐ์ ๊ณ์ ์ฐฝ์ด๋ ์ค์น ๊ฐ์ด๋์์ ํ์ธํ ์ ์๋ค.
์ค์ ์ฐฝ์ ๋ฐ๊ธ๋ฐ์ ํ ํฐ์ ์ ๋ ฅํ๊ณ Submit ํ๋ค. ์ ํจ์ฑ ๊ฒ์ฆ๊ณผ ๋์์ ์ด ํ๋ก์ ํธ์์ ์ฌ์ฉ๋ ํ ํฐ์ผ๋ก ์ ์ฅ๋จ.
3. Sample Map ํ์ธํ๊ธฐ
ํด๋น ํ ํฐ์ ์ฌ์ฉํ์ฌ ๊ฐ์ฅ ๊ธฐ๋ณธ์ ์ธ Map Prefab์ ์ ๋๋ก ๋ถ๋ฌ์ค๋์ง ํ์ธํด๋ณด๊ธฐ
- Assets/Mapbox/Prefabs์ ์๋ Map.prefab์ Hierarchy์ ์ถ๊ฐํ๋ค.
- Location ๊ฐ์ ์ ๋ ฅํ๊ณ , Enable Preview๋ฅผ ํ์ฑํํ๋ฉด Scene์์ ์ง๋ ๋ฐ์ดํฐ๋ฅผ ํ์ธํ ์ ์๋ค.
4. ์ฃผ์ ๊ตฌ์ฑ
Mapbox์ Map์ ํ์ผ ์ ๊ณต์์ ํ์ผ ์ค๋ธ์ ํธ๋ก ๊ตฌ์ฑ๋๋ค.
ํ์ผ ์ค๋ธ์ ํธ๋ Terrain์ด ์๋๊ณ Mesh Renderer๋ฅผ ๊ฐ์ง๋ฉฐ Tile ์คํฌ๋ฆฝํธ๋ฅผ ํฌํจํ๋ค.
๋งต ์ค์ ์ ๊ฐ์ฅ ์ต์๋จ์ Map ์ค๋ธ์ ํธ์ Abstract Map ์คํฌ๋ฆฝํธ์์ ๊ด๋ฆฌํ๋ค.
Tile ์์ฑ ๋ณ๊ฒฝ
Map Material์ Texture
'๐ ํ์ต๊ณผ ๊ฐ๋ฐ ๊ธฐ๋ก > Unity' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Mesh Collider ์ต์ ํ - Mesh Cooking (0) | 2022.03.31 |
---|---|
Unity Assembly Version Validation ๊ด๋ จ ์๋ฌ (0) | 2022.02.01 |
MS Bing Maps SDK ์ฌ์ฉํ๊ธฐ (0) | 2021.12.14 |
Google Maps for Unity - Deprecated (0) | 2021.12.14 |
Shader ๊ธฐ๋ณธ๊ฐ๋ (0) | 2021.09.07 |