使用ARFoundation的图像识别发布出来的安卓应用存在一个令初学者挠头的问题——模型始终是背对用户的,虽然可以在3ds
Max等软件中调整其轴心,终归是麻烦。受汪祥春老师《AR开发权威指南基于AR
Foundation》一书的启发,编写如下MultiImageTracking脚本:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
public class MultiImageTracking : MonoBehaviour
{
ARTrackedImageManager ImgTrackedManager;
private Dictionary mPrefabs = new
Dictionary();
public GameObject[] gameObjects;
private void Awake()
{
ImgTrackedManager =
GetComponent();
}
void Start()
{
foreach(var go in
gameObjects)
{
mPrefabs.Add(go.name, go);
}
}
private void OnEn
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
public class MultiImageTracking : MonoBehaviour
{
