/**************************************************************************** * Copyright 2019 Nreal Techonology Limited. All rights reserved. * * This file is part of NRSDK. * * https://www.nreal.ai/ * *****************************************************************************/ using UnityEngine; namespace NRKernal.Experimental.NRExamples { /// A switch plane detect. public class SwitchPlaneDetect : MonoBehaviour { /// Switch plane detect configuration. /// True to flag. private void SwitchPlaneDetectConfig(bool flag) { var config = NRSessionManager.Instance.NRSessionBehaviour.SessionConfig; config.PlaneFindingMode = flag ? TrackablePlaneFindingMode.HORIZONTAL : TrackablePlaneFindingMode.DISABLE; NRSessionManager.Instance.SetConfiguration(config); } /// Enables the plane detect. public void EnablePlaneDetect() { SwitchPlaneDetectConfig(true); } /// Disables the plane detect. public void DisablePlaneDetect() { SwitchPlaneDetectConfig(false); } } }