void Update()
 {
     if (imageManager.trackables.count == 0)
     {
         Debug.Log("PlanetsMainMode no trackables, going to Scan mode");
         InteractionController.EnableMode("Scan");
     }
     else
     {
         Ray        ray = new Ray(camera.transform.position, camera.transform.forward);
         RaycastHit hit;
         if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask))
         {
             Planet planet = hit.collider.GetComponentInParent <Planet>();
             planetName.text         = planet.planetName;
             detailsText.text        = planet.description;
             infoButton.interactable = true;
         }
         else
         {
             planetName.text         = "";
             detailsText.text        = "";
             infoButton.interactable = false;
         }
     }
 }
示例#2
0
 void Update()
 {
     if (faceManager.trackables.count > 0)
     {
         InteractionController.EnableMode("Main");
     }
 }
示例#3
0
    void PlaceObject(Vector2 touchPosition)
    {
        if (raycaster.Raycast(touchPosition, hits, TrackableType.PlaneWithinPolygon))
        {
            Pose hitPose = hits[0].pose;
            Instantiate(placedPrefab, hitPose.position, hitPose.rotation);

            InteractionController.EnableMode("Main");
        }
    }
示例#4
0
 void Update()
 {
     if (ARSession.state == ARSessionState.Unsupported)
     {
         InteractionController.EnableMode("NonAR");
     }
     else if (ARSession.state >= ARSessionState.Ready)
     {
         //Debug.Log("state " + ARSession.state);
         InteractionController.EnableMode(nextMode);
     }
 }
 public void ImageSelected(ImageInfo image)
 {
     if (isReplacing)
     {
         editPicture.currentPicture.SetImage(image);
         InteractionController.EnableMode("EditPicture");
     }
     else
     {
         addPicture.imageInfo = image;
         InteractionController.EnableMode("AddPicture");
     }
 }
    void FindObjectToEdit(Vector2 touchPosition)
    {
        Ray        ray = camera.ScreenPointToRay(touchPosition);
        RaycastHit hit;
        int        layerMask = 1 << LayerMask.NameToLayer("PlacedObjects");

        if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask))
        {
            FramedPhoto07 picture = hit.collider.GetComponentInParent <FramedPhoto07>();
            editMode.currentPicture = picture;
            InteractionController.EnableMode("EditPicture");
        }
    }
示例#7
0
    void PlaceObject(Vector2 touchPosition)
    {
        if (raycaster.Raycast(touchPosition, hits, TrackableType.PlaneWithinPolygon))
        {
            ARRaycastHit hit = hits[0];

            Vector3    position = hit.pose.position;
            Vector3    normal   = -hit.pose.up;
            Quaternion rotation = Quaternion.LookRotation(normal, Vector3.up);

            GameObject spawned = Instantiate(placedPrefab, position, rotation);

            FramedPhoto picture = spawned.GetComponent <FramedPhoto>();
            picture.SetImage(imageInfo);

            spawned.transform.localScale = new Vector3(defaultScale, defaultScale, 1.0f);

            spawned.transform.SetParent(transform.parent);

            InteractionController.EnableMode("Main");
        }
    }
示例#8
0
 public void SelectImageToReplace()
 {
     selectImage.isReplacing = true;
     InteractionController.EnableMode("SelectImage");
 }
示例#9
0
 public void DeletePicture()
 {
     GameObject.Destroy(currentPicture.gameObject);
     InteractionController.EnableMode("Main");
 }
示例#10
0
 void OnClick(ImageInfo image)
 {
     //Debug.Log($"Image clicked {image.texture.name}");
     addPicture.imageInfo = image;
     InteractionController.EnableMode("AddPicture");
 }
 public void SelectImageToAdd()
 {
     selectImage.isReplacing = false;
     InteractionController.EnableMode("SelectImage");
 }