Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.XR.ARFoundation;
  3.  
  4. public class PlaneDetection : MonoBehaviour
  5. {
  6.     public ARPlaneManager PlaneManager;
  7.  
  8.     public void Merge()
  9.     {
  10.         ARPlane maxArPlane = default;
  11.         float maxSize = -1;
  12.         foreach (var plane in PlaneManager.trackables)
  13.         {
  14.             var size = plane.size.x * plane.size.y;
  15.             if (size > maxSize)
  16.             {
  17.                 maxArPlane = plane;
  18.                 size = maxSize;
  19.             }
  20.         }
  21.        
  22.        
  23.        
  24.     }
  25.    
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement