下载Unity开发工具
版本要求:Unity 5.6.3及以上
下载地址:
1. https://store.unity.com/cn/download?ref=personal
库和资源导入
1. 创建一个新的工程,在Assets目录下新建一个文件夹,命名为Plugins;将下载的压缩包解压,将TencentMapSDK.dll放到Assets/Plugins目录下。


2. 导入腾讯位置服务Unity 地图SDK Resources资源包:
点击上方主菜单中的Assets,选择Import Package ->Custom Package, 之后选择解压出的TencentMapRes.unitypackage文件。 弹出的窗口中显示导入资源的名称,全选并点击import按钮即可完成导入。

导入成功后可在Assets目录下看到Resources资源包。

资源配置
配置导入资源中的prefab,所在目录为Assets/Resources/Prefabs:
- map_poi_prefab 挂载 POICreator 脚本;
- map_label_prefab 挂载 LabelCreator 脚本;
- map_vector_tile_prefab 挂载 VectorTileController 脚本;
- 如果有自定义字体,则需要将其传入 map_text_prefab 中的 TextMesh Font;
脚本挂载(以map_vector_tile_prefab为例):
点击map_vector_tile_prefab图标,在右侧扩展属性面板inspector中的下方点击Add component按钮, 找到VectorTileController(可以在搜索框中进行搜索),双击后挂载脚本完毕。

自定义字体:
点击map_text_prefab图标,在右侧扩展属性面板inspector中的TextMesh中,找到Font并点击右侧选择键。在弹出的窗口中选择自定义字体。
