コード例 #1
0
 // Use this for initialization
 void Start()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     planesParent         = transform;
     UnityARUtility.InitializePlanePrefab(planePrefab);
     // UnityARUtility.InitializePlanesParent(planesParent);
 }
コード例 #2
0
        // 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);
        }
コード例 #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);
 }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     if (Hit == false)
     {
         unityARAnchorManager = new UnityARAnchorManager();
         UnityARUtility.InitializePlanePrefab(planePrefab);
         Hit = true;
     }
 }
コード例 #6
0
        // Use this for initialization
        void Start()
        {
            unityARAnchorManager = new UnityARAnchorManager();
            UnityARUtility.InitializePlanePrefab(planePrefab);

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

            btn.onClick.AddListener(TaskOnClick);
        }
コード例 #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);
        }
コード例 #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;
     }
 }
コード例 #9
0
        private void OnDisable()
        {
            UnityARUtility.InitializePlanePrefab(null);
            int cl = transform.childCount;

            for (int i = 0; i < cl; i++)
            {
                transform.GetChild(i).gameObject.SetActive(false);
            }
        }
コード例 #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);
        }
コード例 #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;
     }
 }
コード例 #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);
        }
コード例 #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();
                }
            }
        }
コード例 #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;
        }
コード例 #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);
        }
コード例 #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;
        }
コード例 #17
0
 // Use this for initialization
 void Start()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
     planePrefab.tag = "plane";
 }
コード例 #18
0
 // Use this for initialization
 void Start()
 {
     //UIPanels.Instance.configScreens.SetState (ConfigScreens.states.CONFIG_AREA);
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
 }
コード例 #19
0
 private void CreateARAnchor(Anywhere.Notification _notif)
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
 }
コード例 #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));
 }
コード例 #21
0
 public void NewSession()
 {
     unityARAnchorManager.Destroy();
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
 }
コード例 #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);
 }
コード例 #23
0
 public void ShowPlanes()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
     mainCamera.cullingMask = -1;
 }
コード例 #24
0
 // Use this for initialization
 void Start()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab, transform);
 }
コード例 #25
0
 private void Start()
 {
     unityARAnchorManager = new UnityARAnchorManager();
     UnityARUtility.InitializePlanePrefab(planePrefab);
 }