private void OnPlanesChanged(ARPlanesChangedEventArgs args)
    {
        if (args.added != null && args.added.Count > 0)
        {
            arPlanes.AddRange(args.added);
        }
        foreach (ARPlane plane in arPlanes.Where(plane => plane.extents.x * plane.extents.y >= 0.1f))
        {
            if (plane.alignment.IsVertical())
            {
                //vertical plane found
                OnVerticalPlaneFound.Invoke();
            }
            else
            {
                //horizontal plane found
                OnHorizontalPlaneFound.Invoke();
            }

            if (plane.extents.x * plane.extents.y >= dimensionsForBigPlane.x * dimensionsForBigPlane.y)
            {
                //BigPlane found
                OnBigPlaneFound.Invoke();
            }
        }
    }
Ejemplo n.º 2
0
    private void OnPlanesChanged(ARPlanesChangedEventArgs args)
    {
        if (args.added != null && args.added.Count > 0)
        {
            arPlanes.AddRange(args.added);
        }

        //x곱하기 y가 최소 0.1제곱미터
        foreach (ARPlane plane in arPlanes.Where(plane => plane.extents.x * plane.extents.y >= 0.1f))
        {
            if (plane.extents.x * plane.extents.y >= dimensionsForBigPlane.x * dimensionsForBigPlane.y)
            {
                //tell someone we found a big plane
                OnBigPlaneFound.Invoke();
                _positionTxt.text = "준비됨!";
            }
        }
    }