Samples 配置¶
EasyAR插件基于微信小程序及其3D引擎 XR-Frame
运行,请在使用前确保 您已熟悉3D引擎基本知识和小程序本身的开发流程
。
如果您对于微信小程序的基本开发流程还不了解,请先查看 微信小程序开发文档 。
如果您对微信小程序的3D引擎 XR-Frame
还不了解,请先查看 微信小程序XR-Frame文档 。
下载sample¶
通过微信小程序开发工具导入¶

在AppID处输入你的EasyAR LicenseKey对应的AppID,点击Create
更新Mega配置信息¶

配置Mega服务的必要信息(miniprogram/components/sample-data/easyar-settings.ts)。 关于如何获取,请查看说明 。
// LicenseKey由开发中心中Mega微信小程序获取
export const EasyARLicenseKey: string = "";
// API Key及API Secret由开发中心中云服务APIKey获取
export const EasyARAPIKey: string = "";
export const EasyARAPISecret: string = "";
// ServerAddress, AppID及标注数据ID由开发中心中Block云定位库中获取
export const MegaTrackerServerAddress: string = "";
export const MegaTrackerAppID: string = "";
export const MegaAnnotationId: string = "";
更新标注信息¶

metaData中记录的是标注点位与模型的对应关系,使用annotation的id索引获取对应资源的assetId。
annotation 的id可以在Unity编辑器中标注点位时获得

未加载的assetID需要参考sample,自行添加到为XR-Frame Scene的assets中。
export const AnnotationMetaData: Record<string, any> = {
/** 使用 Annotation ID 作为 key */
"a3abec50-4dbb-46cd-a27d-ff91b6e21e51": {
assetId: "panda",
scale: "1 1 1"
},
"10cb4d73-eff0-4f2c-a825-4d833c25ec13": {
assetId: "panda",
scale: "1 1 1"
},
"55387b77-8097-4a40-923e-742cd3276408": {
assetId: "panda",
scale: "1 1 1"
},
...
};