// Use this for initialization
 void Start()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     planesParent         = transform;
     UnityARUtility.InitializePlanePrefab(planePrefab);
     // UnityARUtility.InitializePlanesParent(planesParent);
 }
        // Use this for initialization
        void Start()
        {
            unityARAnchorManager = new UnityARAnchorManager();
            UnityARUtility.InitializePlanePrefab(planePrefab);

            planeCount = 0;
        }
        // Use this for initialization
        void Start()
        {
            Debug.Log("Called UNITYARGENERATEPLANE.CS");
            allThePlanes         = new List <GameObject>();
            unityARAnchorManager = new UnityARAnchorManager();
            UnityARUtility.InitializePlanePrefab(planePrefab);


            planeCollider = planePrefab.GetComponent <Collider>();
            planeCenter   = planeCollider.bounds.center;

            whateverCube = GameObject.CreatePrimitive(PrimitiveType.Cube);

            whateverCube.transform.parent   = planePrefab.transform;
            whateverCube.transform.position = planeCenter;

            allThePlanes.Add(planePrefab);

            Debug.Log("planes detected are: " + allThePlanes.Count);

            //translate to AR world scale (10%)
            //move .05 units up so that the cube sits on the plane
            whateverCube.transform.localScale = new Vector3(.1f, .1f, .1f);
            whateverCube.transform.position   = new Vector3(0, .05f, 0);
            //whateverCube.transform.localScale = new Vector3(planeCenter.x * 0.1f ,planeCenter.y * 0.1f ,planeCenter.z * 0.1f );

            //   GameObject go = Instantiate(whateverCube,planeCenter,Quaternion.identity);
        }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     //  ManagerScript.instance.AddPlaneRenderer(planePrefab);
     //Debug.LogWarning("UnityARGeneratePlane");
     ManagerScript.instance.AssignARPrefab(planePrefab);
     UnityARUtility.InitializePlanePrefab(planePrefab);
 }
 // Use this for initialization
 void Start()
 {
     if (Hit == false)
     {
         unityARAnchorManager = new UnityARAnchorManager();
         UnityARUtility.InitializePlanePrefab(planePrefab);
         Hit = true;
     }
 }
Exemplo n.º 6
0
        // Use this for initialization
        void Start()
        {
            unityARAnchorManager = new UnityARAnchorManager();
            UnityARUtility.InitializePlanePrefab(planePrefab);

            Button btn = freezeSun.GetComponent <Button>();

            btn.onClick.AddListener(TaskOnClick);
        }
Exemplo n.º 7
0
        public void initStart()
        {
            analytic.time_startFindPlane = Time.time;
            planePrefab.SetActive(true);
            UnityARHitTestExample hitScript = hitParent.GetComponentInChildren <UnityARHitTestExample>();

            unityARAnchorManager = new UnityARAnchorManager(this, hitParent, hitScript, Camera_managerScrpt);
            UnityARUtility.InitializePlanePrefab(planePrefab);
        }
Exemplo n.º 8
0
 public void UpdateAnchor(ARPlaneAnchor arPlaneAnchor)
 {
     if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
     {
         ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
         UnityARUtility.UpdatePlaneWithAnchorTransform(arpag.gameObject, arPlaneAnchor);
         arpag.planeAnchor = arPlaneAnchor;
         planeAnchorMap [arPlaneAnchor.identifier] = arpag;
     }
 }
        private void OnDisable()
        {
            UnityARUtility.InitializePlanePrefab(null);
            int cl = transform.childCount;

            for (int i = 0; i < cl; i++)
            {
                transform.GetChild(i).gameObject.SetActive(false);
            }
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
0
 public void UpdateAnchor(ARPlaneAnchor arPlaneAnchor)
 {
     if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
     {
         ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
         UnityARUtility.UpdatePlaneWithAnchorTransform(arpag.gameObject, arPlaneAnchor);
         arpag.planeAnchor = arPlaneAnchor;
         planeAnchorMap [arPlaneAnchor.identifier] = arpag;
         bound = arpag.gameObject.GetComponentInChildren <MeshRenderer>().bounds;
     }
 }
Exemplo n.º 12
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);
        }
Exemplo n.º 13
0
        public void UpdateAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
            {
                ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
                UnityARUtility.UpdatePlaneWithAnchorTransform(arpag.gameObject, arPlaneAnchor);
                arpag.planeAnchor = arPlaneAnchor;
                planeAnchorMap [arPlaneAnchor.identifier] = arpag;

                DebugPlaneTiler planeTiler = arpag.gameObject.GetComponentInChildren <DebugPlaneTiler>();
                if (planeTiler)
                {
                    planeTiler.UpdateWithinList();
                }
            }
        }
Exemplo n.º 14
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;
        }
Exemplo n.º 15
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;

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

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

            planeAnchorMap.Add(arPlaneAnchor.identifier, arpag);
        }
Exemplo n.º 16
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;
        }
Exemplo n.º 17
0
 // Use this for initialization
 void Start()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
     planePrefab.tag = "plane";
 }
Exemplo n.º 18
0
 // Use this for initialization
 void Start()
 {
     //UIPanels.Instance.configScreens.SetState (ConfigScreens.states.CONFIG_AREA);
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
 }
Exemplo n.º 19
0
 private void CreateARAnchor(Anywhere.Notification _notif)
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
 }
Exemplo n.º 20
0
 //public static float height_y;
 //public static Bounds bound;
 //public static Bounds bound2;//使用一个平面还是两个?如果两个的话,启用bound2
 // Use this for initialization
 void Start()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
     // bound2 = new Bounds(new Vector3(0, 0, 0), new Vector3(0, 0, 0));
 }
Exemplo n.º 21
0
 public void NewSession()
 {
     unityARAnchorManager.Destroy();
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
 }
Exemplo n.º 22
0
 // Use this for initialization
 void Start()
 {
     Debug.Log("I am a generate plane and I am being created!");
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
 }
 public void ShowPlanes()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
     mainCamera.cullingMask = -1;
 }
 // Use this for initialization
 void Start()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab, transform);
 }
Exemplo n.º 25
0
 private void Start()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
 }