This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
ARPlusSystem/ARPlusSystem-250418/Library/PackageCache/com.unity.xr.arfoundation@4.../Tests/Runtime/ARMeshManagerTests.cs

39 lines
1.3 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine.TestTools;
using UnityEngine.XR.ARSubsystems;
using UnityEngine.XR.Management;
namespace UnityEngine.XR.ARFoundation
{
[TestFixture]
class ARMeshManagerTests
{
ARSessionOrigin m_SessionOrigin;
ARMeshManager m_MeshManager;
Transform m_Content;
[Test]
public void CanGetARSessionOriginAfterMakeContentAppearAt()
{
m_SessionOrigin.MakeContentAppearAt(m_Content, new Vector3(1, 2, 3));
Assert.NotNull(m_MeshManager.GetSessionOrigin(), $"The {nameof(ARSessionOrigin)} was null after a call to {nameof(ARSessionOrigin.MakeContentAppearAt)}");
}
[OneTimeSetUp]
public void Setup()
{
var sessionOriginGO = new GameObject("Session Origin");
m_SessionOrigin = sessionOriginGO.AddComponent<ARSessionOrigin>();
var meshManagerGO = new GameObject("Meshing");
meshManagerGO.transform.parent = sessionOriginGO.transform;
m_MeshManager = meshManagerGO.AddComponent<ARMeshManager>();
var contentGO = GameObject.CreatePrimitive(PrimitiveType.Cube);
contentGO.name = "Content";
m_Content = contentGO.transform;
}
}
}