예제 #1
0
 void IPointerGripClickHandler.OnPointerGripClick(XREventData eventData)
 {
     Debug.Log(this.name + " received OnPointerGripClick from " + eventData.module.name);
 }
예제 #2
0
 void IGlobalYTouchDownHandler.OnGlobalYTouchDown(XREventData eventData)
 {
     Debug.Log(this.name + " received OnGlobalYTouchDown from " + eventData.module.name);
     gYTouch = true;
 }
예제 #3
0
 void IGlobalYTouchUpHandler.OnGlobalYTouchUp(XREventData eventData)
 {
     Debug.Log(this.name + " received OnGlobalYTouchUp from " + eventData.module.name);
     gYTouch = false;
 }
예제 #4
0
 public void OnGlobalTouchpadPressUp(XREventData eventData)
 {
 }
예제 #5
0
 void IGlobalYTouchHandler.OnGlobalYTouch(XREventData eventData)
 {
     Debug.Log(this.name + " received OnGlobalYTouch from " + eventData.module.name);
 }
예제 #6
0
 void IPointerThumbstickTouchDownHandler.OnPointerThumbstickTouchDown(XREventData eventData)
 {
     Debug.Log(this.name + " received OnPointerThumbstickTouchDown from " + eventData.module.name);
     pThumbstickTouch = true;
 }
예제 #7
0
 void IPointerTouchpadPressHandler.OnPointerTouchpadPress(XREventData eventData)
 {
     Debug.Log(this.name + " received OnPointerTouchpadPress from " + eventData.module.name);
 }
예제 #8
0
 public void OnGlobalTouchpadPressDown(XREventData eventData)
 {
     TryHold(eventData.module, ButtonType.TouchpadPress);
 }
예제 #9
0
 public void OnGlobalTriggerPressDown(XREventData eventData)
 {
     TryHold(eventData.module, ButtonType.TriggerPress);
 }
예제 #10
0
 public void OnGlobalMenuPressDown(XREventData eventData)
 {
     TryHold(eventData.module, ButtonType.Menu);
 }
예제 #11
0
 public void OnGlobalGripPressDown(XREventData eventData)
 {
     TryHold(eventData.module, ButtonType.Grip);
 }
예제 #12
0
 public void OnGlobalTouchpadTouch(XREventData eventData)
 {
     Debug.Log("My " + eventData.hand + " hand is touching the Touchpad!");
 }
예제 #13
0
    public void OnPointerTriggerPressDown(XREventData eventData)
    {
        Color color = (eventData.hand == XRHand.Left ? Color.blue : Color.red);

        SetColor(color);
    }
예제 #14
0
    public void OnGlobalTriggerPressDown(XREventData eventData)
    {
        GameObject chalk           = GameObject.FindGameObjectWithTag("Drawer");
        GameObject chooseButterfly = GameObject.FindGameObjectWithTag("chooseButterfly");
        GameObject chooseGuitar    = GameObject.FindGameObjectWithTag("chooseGuitar");
        GameObject chooseBeach     = GameObject.FindGameObjectWithTag("chooseBeach");
        GameObject chooseDog       = GameObject.FindGameObjectWithTag("chooseDog");
        GameObject chooseRide      = GameObject.FindGameObjectWithTag("chooseRide");
        GameObject chooseSmall     = GameObject.FindGameObjectWithTag("chooseSmall");
        GameObject chooseMedium    = GameObject.FindGameObjectWithTag("chooseMedium");
        GameObject chooseLarge     = GameObject.FindGameObjectWithTag("chooseLarge");

        if (chooseButterfly)
        {
            if (chooseButterfly.GetComponent <Button>().colors.normalColor == Color.red)
            {
                chalk = setModel(chalk, butterfly);
            }
            else if (chooseGuitar.GetComponent <Button>().colors.normalColor == Color.red)
            {
                chalk = setModel(chalk, guitar);
            }

            cleanUp();
        }
        else
        {
            if (chooseBeach)
            {
                chalk = setModel(chalk, beach);
                cleanUp();
            }
            if (chooseDog)
            {
                chalk = setModel(chalk, dog);
                // cleanUp();
                GameObject canvas = GameObject.FindGameObjectWithTag("UI");
                canvas.SetActive(false);

                sizeCanvas.SetActive(true);
            }
            if (chooseRide)
            {
                chalk = setModel(chalk, ride);
                cleanUp();
            }

            if (chooseSmall)
            {
                if (chooseSmall.GetComponent <Button>().colors.normalColor == Color.red) // small
                {
                    chalk.GetComponent <PickUppable>().scale = 0.5f;
                }
                else if (chooseMedium.GetComponent <Button>().colors.normalColor == Color.red) // medium
                {
                    chalk.GetComponent <PickUppable>().scale = 1f;
                }
                else // large
                {
                    chalk.GetComponent <PickUppable>().scale = 5f;
                }
                cleanUp();
            }
        }
    }
예제 #15
0
 void IPointerGripPressUpHandler.OnPointerGripPressUp(XREventData eventData)
 {
     Debug.Log(this.name + " received OnPointerGripPressUp from " + eventData.module.name);
     pGripPress = false;
 }
예제 #16
0
 void IGlobalTriggerPressDownHandler.OnGlobalTriggerPressDown(XREventData eventData)
 {
     Debug.Log(this.name + " received OnGlobalTriggerPressDown from " + eventData.module.name);
     gTriggerPress = true;
 }
예제 #17
0
 void IPointerThumbstickTouchHandler.OnPointerThumbstickTouch(XREventData eventData)
 {
     Debug.Log(this.name + " received OnPointerThumbstickTouch from " + eventData.module.name);
 }
예제 #18
0
 void IGlobalXPressUpHandler.OnGlobalXPressUp(XREventData eventData)
 {
     Debug.Log(this.name + " received OnGlobalXPressUp from " + eventData.module.name);
     gXPress = false;
 }
예제 #19
0
 void IPointerThumbstickTouchUpHandler.OnPointerThumbstickTouchUp(XREventData eventData)
 {
     Debug.Log(this.name + " received OnPointerThumbstickTouchUp from " + eventData.module.name);
     pThumbstickTouch = false;
 }
예제 #20
0
 void IGlobalYPressHandler.OnGlobalYPress(XREventData eventData)
 {
     Debug.Log(this.name + " received OnGlobalYPress from " + eventData.module.name);
 }
예제 #21
0
 void IPointerTouchpadPressDownHandler.OnPointerTouchpadPressDown(XREventData eventData)
 {
     Debug.Log(this.name + " received OnPointerTouchpadPressDown from " + eventData.module.name);
     pTouchpadPress = true;
 }
예제 #22
0
    public void OnPointerTriggerPressUp(XREventData eventData)
    {
        if (grip == true)
        {
            grip = false;
            coll = null;
            release();
            if (GameObject.FindGameObjectsWithTag("brushStroke").Length > 0)
            {
                GameObject chalk = GameObject.FindGameObjectWithTag("Drawer");
                Renderer   rend2 = chalk.GetComponent <Renderer>();

                GameObject[] allObjects = GameObject.FindGameObjectsWithTag("brushStroke");
                for (int i = 0; i < allObjects.Length; i++)
                {
                    Destroy(allObjects[i]);
                }

                if (timeline.tag != "BeachTimeline")
                {
                    anim.Play("Paper");
                }


                if (modelObject.tag != "Scene")
                {
                    GameObject obj = Instantiate(modelObject);
                    obj.transform.localScale = new Vector3(scale, scale, scale);
                    if (modelColor != Color.black)
                    {
                        Transform[] children = obj.GetComponentsInChildren <Transform>();
                        Renderer    rend     = obj.GetComponent <Renderer>();
                        if (children.Length > 1)
                        {
                            for (int i = 1; i < children.Length; i++)
                            {
                                GameObject child     = children[i].gameObject;
                                Renderer   childRend = child.GetComponent <Renderer>();
                                childRend.material.shader = Shader.Find("_Color"); // get color of brush stroke
                                childRend.material.SetColor("_Color", modelColor);
                                Shader sh = Shader.Find("Diffuse");
                                childRend.material.shader = sh;
                            }
                        }
                        else
                        {
                            rend.material.SetColor("_Color", modelColor);
                        }

                        //Shader sh = Shader.Find("Diffuse");
                        //rend.material.shader = sh;
                        // modelColor = Color.black;
                    }
                    if (modelObject.tag == "guitar")
                    {
                        audioData.Play();
                        userAudio2.Play();
                    }
                    else if (modelObject.tag == "butterfly")
                    {
                        userAudio1.Play();
                    }
                    else if (modelObject.tag == "ride")
                    {
                        userAudio1.Play();
                    }
                    else
                    {
                        audioData.Play();
                        userAudio2.Play();
                    }
                    if (timeline.tag != "BeachTimeline")
                    {
                        timeline.GetComponent <PauseTimeline>().playTimeline();
                    }
                    else
                    {
                        timeline.GetComponent <BeachTimelineController>().playTimeline();
                    }
                }
                else
                {
                    if (timeline.tag != "BeachTimeline")
                    {
                        timeline.GetComponent <PauseTimeline>().playTimeline();
                    }
                    else
                    {
                        timeline.GetComponent <BeachTimelineController>().playTimeline();
                    }
                }
            }
        }
    }