Esempio n. 1
0
 // Click on the cat to summon it
 public void OnPointerClick(PointerEventData eventData)
 {
     if ((eventData.IsViveButton(ControllerButton.Trigger)) && (SelectedTool.HAND == catScript.selected_tool || SelectedTool.BRUSH == catScript.selected_tool))
     {
         //Debug.Log("Controller clicked on cat.");
         catScript.turnOnUserInteractionCatBehavior();
     }
 }
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.IsViveButton(ControllerButton.Trigger))
     {
         // Trigger button pressed
     }
     else if (eventData.button == PointerEventData.InputButton.Left)
     {
         // Standalone button pressed
     }
 }
Esempio n. 3
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.IsViveButton(ControllerButton.Trigger))
     {
         Debug.Log("Vive button triggered!");
     }
     else if (eventData.button == PointerEventData.InputButton.Left)
     {
         Debug.Log("Standalone button triggered!");
     }
 }
Esempio n. 4
0
    public void OnPointerClick(PointerEventData eventData)
    {
        if (eventData.IsViveButton(ControllerButton.Trigger))
        {
            // Trigger button pressed
            if (catScript.selected_tool == SelectedTool.FOOD)
            {
                kibble.SetActive(true);
            }
        }

        else if (eventData.button == PointerEventData.InputButton.Left)
        {
            // Standalone button triggered!
        }
    }
    public void OnPointerClick(PointerEventData eventData)
    {
        if (eventData.IsViveButton(ControllerButton.Trigger))
        {
            // Trigger button pressed
            Debug.Log("Clicked on catnip.");
            UI_Effects.SetActive(false);                        // Turn off visual effects

            // If not currently on catnip, use catnip
            if (!catScript.on_catnip)
            {
                StartCoroutine(catScript.useCatnip());
            }
        }
        else if (eventData.button == PointerEventData.InputButton.Left)
        {
            // Standalone button triggered!
        }
    }
Esempio n. 6
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.IsViveButton(ControllerButton.Trigger) || true)
     {
         OwnershipRequired(true);
         Debug.Log("Bar Click");
         var        pContainer = transform.Find("Points");
         GameObject capsule    = Instantiate(swatchPrefab, new Vector3(0, transform.InverseTransformPoint(eventData.pointerCurrentRaycast.worldPosition).y, 0.04f), Quaternion.identity);
         //GameObject capsule = GameObject.CreatePrimitive(PrimitiveType.Capsule);
         capsule.transform.parent        = pContainer.transform;
         capsule.transform.localPosition = new Vector3(0, transform.InverseTransformPoint(eventData.pointerCurrentRaycast.worldPosition).y, 0.04f);
         capsule.transform.localScale    = new Vector3(0.1f, 0.1f, 0.1f);
         capsule.GetComponent <TransferFunctionSwatch>().setColor(Color.yellow);
         OwnershipRequired(false);
     }
     else if (eventData.button == PointerEventData.InputButton.Left)
     {
         Debug.Log("Bar ClickLeft");
     }
 }
Esempio n. 7
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.IsViveButton(ControllerButton.Trigger))
     {
         if (!wasMoved)
         {
             if (!choosing)
             {
                 startColorChoosing();
             }
             else
             {
                 stopColorChoosing();
             }
         }
     }
     else if (eventData.button == PointerEventData.InputButton.Left)
     {
         Debug.Log("Swatch ClickLeft");
     }
 }
Esempio n. 8
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.IsViveButton(ControllerButton.Trigger))
     {
         // Trigger button pressed
         Debug.Log("Music toggled on/off.");
         if (!backgroundMusic.isPlaying)
         {
             backgroundMusic.Play();
             particleEffects.SetActive(true);
         }
         else
         {
             backgroundMusic.Stop();
             particleEffects.SetActive(false);
         }
     }
     else if (eventData.button == PointerEventData.InputButton.Left)
     {
         // Standalone button pressed
     }
 }
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.IsViveButton(ControllerButton.Trigger))
     {
         // Trigger button pressed
         if (catScript.selected_tool == SelectedTool.LITTER_SCOOPER)
         {
             // Find first active poop
             foreach (GameObject poop in poops)
             {
                 if (poop.activeSelf == true)
                 {
                     catScript.achievements.litter_box_cleaned += 1;
                     poop.SetActive(false);
                     return;
                 }
             }
         }
     }
     else if (eventData.button == PointerEventData.InputButton.Left)
     {
         // Standalone button triggered!
     }
 }