三、多图跟踪
1.环境搭建请移步 ARFoundation系列讲解-15图像跟踪
2.新建一个脚本命名为 MultiImageTracking 代码如下
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
/// <summary>多图跟踪</summary>
public class MultiImageTracking : MonoBehaviour
{
private ARTrackedImageManager ImgTrackedManager;
private List<GameObject> mPrefabs = new List<GameObject>();
private void Awake()
{
ImgTrackedManager = GetComponent<ARTrackedImageManager>();
}
private void Start()
{
mPrefabs.Add(Resources.Load("你需要加载资源路径") as GameObject);
mPrefabs.Add(Reso