Esempio n. 1
0
    private void ProcessTouch()
    {
        if (Input.touchCount == 0)
        {
            return;
        }

        foreach (Touch touch in Input.touches)
        {
            if (touch.phase == TouchPhase.Began)
            {
                RaycastHit hit;
                Ray        ray = Camera.main.ScreenPointToRay(touch.position);
                previousRay = ray;
                // Get shonky and show inspector if we hit a shony, otherwise hide it.
                if (Physics.Raycast(ray, out hit, Mathf.Infinity))
                {
                    Shonky shonky = hit.transform.GetComponent <Shonky>();
                    if (shonky != null)
                    {
                        ShowInspectionMenu(shonky);
                    }
                }
                else
                {
                    HideInspectionMenu();
                }
            }
        }
    }
Esempio n. 2
0
 private void ProcessMouse()
 {
     if (Input.GetMouseButtonDown(0))
     {
         RaycastHit hit;
         Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         previousRay = ray;
         // Get shonky and show inspector if we hit a shony, otherwise hide it.
         if (Physics.Raycast(ray, out hit, Mathf.Infinity))
         {
             Shonky shonky = hit.transform.GetComponent <Shonky>();
             if (shonky != null)
             {
                 ShowInspectionMenu(shonky);
             }
         }
         else
         {
             HideInspectionMenu();
         }
     }
 }
Esempio n. 3
0
 private void ShowInspectionMenu(Shonky shonky)
 {
     inspectionPanel.SetActive(true);
     //textHeading.text = shonky.ItemName();
     //textInfo.text = shonky.ItemInfo();
 }