Пример #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;
        }
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     arSessionOrigin     = FindObjectOfType <ARSessionOrigin>();
     arPointCloudManager = FindObjectOfType <ARPointCloudManager>();
     arPointCloudManager.pointCloudsChanged += UpdatedCloudPoints;
     arVisualizer = GetComponent <ARPointCloudParticleVisualizer>();
 }
Пример #3
0
 // Update is called once per frame
 void Update()
 {
     if (placementFinished && arPointCloud == null)
     {
         arPointCloud = arSessionOrigin.trackablesParent.GetComponentInChildren <ARPointCloud>();
     }
     if (arVisualizer == null)
     {
         arVisualizer = arSessionOrigin.trackablesParent.GetComponentInChildren <ARPointCloudParticleVisualizer>();
     }
 }