Beispiel #1
0
    void SpawnHistoricCube()
    {
        for (int i = 0; i < vectorList.Count; i++)
        {
            Vector3    vectorY    = new Vector3(vectorList[i].x, -1, vectorList[i].z);
            GameObject ARsContent = Instantiate(ARContentObject, vectorY, Quaternion.identity);

            ARContent arContent = ARsContent.GetComponent <ARContent>();
            arContent.SetUpContent(historicLocations[i]);

            _ShowAndroidToastMessage($"{vectorY.ToString()}");
            //TODO: Make sure to call the functions of ARContent class
        }
    }
Beispiel #2
0
    void ProcessTouch()
    {
        if ((Input.touchCount > 0) && (Input.GetTouch(0).phase == TouchPhase.Began))
        {
            Ray raycast = ARCamera.ScreenPointToRay(Input.GetTouch(0).position);
            //Camera.main.ScreenPointToRay(Input.GetTouch(0).position);

            RaycastHit raycastHit;

            if (Physics.Raycast(raycast, out raycastHit))
            {
                // first implementation

                if (raycastHit.collider.CompareTag(ConstantString.MapPointerTag))
                {
                    _ShowAndroidToastMessage("FIRST: raycastHit.collider.CompareTag(ConstantString.MapPointerTag)\n\n" +
                                             "raycastHit.collider.GetComponent<ARContent>().MapPointerClicked();");

                    /*raycastHit.collider.GetComponentInParent<ARContent>().MapPointerClicked();
                     *
                     * raycastHit.collider.GetComponentInChildren<ARContent>().MapPointerClicked();*/

                    if (PopUp != null)
                    {
                        Destroy(PopUp);
                    }

                    ARContent content = raycastHit.collider.GetComponentInParent <ARContent>();

                    if (content != null)
                    {
                        PopUp = Instantiate(ARContentPopUp);
                        PopUp.GetComponent <ARContentPopUpScript>().SetUp(content);
                    }
                    else
                    {
                        ARContent contentchild = raycastHit.collider.GetComponentInChildren <ARContent>();

                        if (contentchild != null)
                        {
                            PopUp = Instantiate(ARContentPopUp);
                            PopUp.GetComponent <ARContentPopUpScript>().SetUp(contentchild);
                        }
                    }


                    _ShowAndroidToastMessage("Completed FIRST call");
                }/*else if (raycastHit.collider.CompareTag(ConstantString.VideoButtonTag))
                  * {
                  * raycastHit.collider.GetComponentInParent<ARContent>().PlayButtonClicked();
                  * raycastHit.collider.GetComponentInChildren<ARContent>().PlayButtonClicked();
                  *
                  * }else if (raycastHit.collider.CompareTag(ConstantString.TextContentButtonTag))
                  * {
                  * raycastHit.collider.GetComponentInParent<ARContent>().TextButtonClicked();
                  * raycastHit.collider.GetComponentInChildren<ARContent>().TextButtonClicked();
                  *
                  * }*/
            }
        }
    }
 public void SetUp(ARContent ARContent)
 {
     arContent = ARContent;
 }