1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
-
- namespace NRKernal.NRExamples
- {
- using System.Collections.Generic;
- using UnityEngine;
-
- public class DetectedPlaneGenerator : MonoBehaviour
- {
-
- public GameObject DetectedPlanePrefab;
-
-
-
- private List<NRTrackablePlane> m_NewPlanes = new List<NRTrackablePlane>();
-
- public void Update()
- {
-
- if (NRFrame.SessionStatus != SessionState.Running)
- {
- return;
- }
-
- NRFrame.GetTrackables<NRTrackablePlane>(m_NewPlanes, NRTrackableQueryFilter.New);
- for (int i = 0; i < m_NewPlanes.Count; i++)
- {
-
-
-
- GameObject planeObject = Instantiate(DetectedPlanePrefab, Vector3.zero, Quaternion.identity, transform);
- planeObject.GetComponent<DetectedPlaneVisualizer>().Initialize(m_NewPlanes[i]);
- }
- }
- }
- }
|