Exemple #1
0
        public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            GameObject go = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);

            go.AddComponent <DontDestroyOnLoad> ();             //this is so these GOs persist across scene loads
            ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject();

            arpag.planeAnchor = arPlaneAnchor;
            arpag.gameObject  = go;
            planeAnchorMap.Add(arPlaneAnchor.identifier, arpag);
        }
Exemple #2
0
        public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            GameObject gameObject = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);

            gameObject.AddComponent <DontDestroyOnLoad>();
            ARPlaneAnchorGameObject aRPlaneAnchorGameObject = new ARPlaneAnchorGameObject();

            aRPlaneAnchorGameObject.planeAnchor = arPlaneAnchor;
            aRPlaneAnchorGameObject.gameObject  = gameObject;
            planeAnchorMap.Add(arPlaneAnchor.identifier, aRPlaneAnchorGameObject);
        }
Exemple #3
0
        public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            GameObject go = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);

            go.AddComponent <DontDestroyOnLoad> ();             //this is so these GOs persist across scene loads
            ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject();

            arpag.planeAnchor = arPlaneAnchor;
            arpag.gameObject  = go;
            planeAnchorMap.Add(arPlaneAnchor.identifier, arpag);
            //下面是自己写的
            //if(planeAnchorMap.Count>1){
            //    RemoveAnchor(lastARPlaneAnchor);
            //}
            bound             = go.GetComponentInChildren <MeshRenderer>().bounds;
            lastARPlaneAnchor = arPlaneAnchor;
        }
        public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            GameObject go = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);

            go.AddComponent <DontDestroyOnLoad> ();             //this is so these GOs persist across scene loads
            ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject();

            arpag.planeAnchor = arPlaneAnchor;
            arpag.gameObject  = go;

            DebugPlaneTiler planeTiler = go.GetComponentInChildren <DebugPlaneTiler>();

            if (planeTiler)
            {
                planeTiler.AddToList();
            }

            planeAnchorMap.Add(arPlaneAnchor.identifier, arpag);
        }
Exemple #5
0
        public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            GameObject go = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);

            go.AddComponent <DontDestroyOnLoad> ();                     //this is so these GOs persist across scene loads
            ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject();

            arpag.planeAnchor = arPlaneAnchor;
            arpag.gameObject  = go;
            planeAnchorMap.Add(arPlaneAnchor.identifier, arpag);

            UnityARSessionNativeInterface.ARAnchorAddedEvent -= AddAnchor;


            //modified
            PlaneAppearDetector detector = generatedPlane;

            detector.planeDetect();
            detector = hitScript;
            detector.planeDetect();
            PlaneDetectorSwitcher switcher = Camera_managerScrpt;
        }