Beispiel #1
0
    public void PlaneToggle()
    {
        planesAreVisible = !planesAreVisible;

        //disables/enables prefabs for planes found in future
        arPlaneManager.planePrefab.SetActive(planesAreVisible);

        //disables/enables renderering existing planes
        foreach (GameObject plane in GameObject.FindGameObjectsWithTag("AR Plane"))
        {
            Renderer r = plane.GetComponent <Renderer>();
            ARPlaneMeshVisualizer t = plane.GetComponent <ARPlaneMeshVisualizer>();
            r.enabled = planesAreVisible;
            t.enabled = planesAreVisible;
        }

        //disables/enables prefabs for points found in future
        arPointCloudManager.pointCloudPrefab.SetActive(planesAreVisible);

        //disables/enables renderering existing points
        foreach (GameObject point in GameObject.FindGameObjectsWithTag("AR Points"))
        {
            Renderer r = point.GetComponent <Renderer>();
            ARPointCloudParticleVisualizer t = point.GetComponent <ARPointCloudParticleVisualizer>();
            r.enabled = planesAreVisible;
            t.enabled = planesAreVisible;
        }
    }
Beispiel #2
0
 // Start is called before the first frame update
 void Start()
 {
     planePrefab          = arPlaneManager.planePrefab;
     planeMeshVizualizer  = planePrefab.GetComponent <ARPlaneMeshVisualizer>();
     initialMaterialAlpha = (defaultMaterial.color.a == 0) ? .33f : defaultMaterial.color.a;
     planesEnabled        = true;
     EnablePlanes();
 }
    private void Awake()
    {
#if !(UNITY_EDITOR || UNITY_STANDALONE)
        _plane               = GetComponent <ARPlane>();
        _planeMaterial       = GetComponent <MeshRenderer>().material;
        _planeMeshVisualizer = GetComponent <ARPlaneMeshVisualizer>();
#endif
    }
Beispiel #4
0
 public void OnTogglePlanes(bool flag)
 {
     showPlanes = flag;
     // Loop through all the planes to disable of enable them
     foreach (GameObject plane in GameObject.FindGameObjectsWithTag("plane"))
     {
         Renderer r = plane.GetComponent <Renderer>();
         ARPlaneMeshVisualizer t = plane.GetComponent <ARPlaneMeshVisualizer>();
         r.enabled = flag;
         t.enabled = flag;
     }
 }
Beispiel #5
0
 void ARPlaneMeshVisualizer_meshUpdated(ARPlaneMeshVisualizer planeMeshVisualizer)
 {
     GenerateBoundaryUVs(planeMeshVisualizer.mesh);
 }
Beispiel #6
0
 void Awake()
 {
     m_PlaneMeshVisualizer    = GetComponent <ARPlaneMeshVisualizer>();
     m_FeatheredPlaneMaterial = GetComponent <MeshRenderer>().material;
 }
 void Awake()
 {
     m_PlaneMeshVisualizer = GetComponent <ARPlaneMeshVisualizer>();
     m_PlaneTransform      = GetComponent <Transform>();
 }