Einheit Version - 2022.3.26f1
VUForia Version - 10.28.4
Area -Zielgenerator - 10.29.6 < /p>
Verwenden Sie traditionelle Art und Weise in Einheit Erstellen Sie Area Target
Hierarchie -> Klicken Sie mit der rechten Maustaste -> Vufforia Engine -> areatarget -> areatarget
Es funktioniert fein < /p> < BR /> Verwenden von Vufforia -Skript zum Laden von Bereichszielen im Erhalten von Problemen
Ich benötige einen alten Versionsbereich für Windows für Windows. Ich kann auf der VUForia -Website nicht finden Von der SD -Karte, die dieses Skript verwendet, aber nicht unterstütztes < /p>
laden, sagen jedoch nicht unterstütztes Format, aber ich erstelle mit der neuesten Version < /p>
Skript zum Laden von Bereichszielen
Code: Select all
using System.Collections.Generic;
using System.Collections;
using System.IO;
using UnityEngine;
using Vuforia;
using System.IO;
public class CreateFromDatabase : MonoBehaviour
{
[SerializeField] private string dataSetPath = "Assets/StreamingAssets/Vuforia/4th.dat";
[SerializeField] private string targetName = "4th";
// Start is called before the first frame update
void Start()
{
VuforiaApplication.Instance.OnVuforiaInitialized += OnVuforiaInitialized;
}
void OnVuforiaInitialized(VuforiaInitError error)
{
if (error == VuforiaInitError.NONE)
OnVuforiaStarted();
}
// Assets/StreamingAssets/Vuforia/4th.dat
//"C:/Users/Aniz_Zainab/AppData/LocalLow/DefaultCompany/ARPrefabDyamic/4th.dat",
// "/storage/emulated/0/Android/data/com.vuforia.engine.coresamples/files/Vuforia/4th.dat",
// Load and activate a data set at the given path.
void OnVuforiaStarted()
{
var mAreaTarget = VuforiaBehaviour.Instance.ObserverFactory.CreateAreaTarget(
databasePath: dataSetPath,
targetName: targetName,
hasOcclusion: true,
hasCollision: false,
occlusionModelPath: "/OcclusionModelPath/",
requiresExternalPositions: false
);
mAreaTarget.OnTargetStatusChanged += OnTargetStatusChanged;
}
void OnTargetStatusChanged(ObserverBehaviour behaviour, TargetStatus status)
{
Debug.Log($"target status: {status.Status}");
}