Exemplo n.º 1
0
    // LocalTouchEventCallback
    void LocalTouchEventCallback(object sender, EventArgs args)
    {
        var touchArgs = (OVRTouchpad.TouchArgs)args;

        OVRTouchpad.TouchEvent touchEvent = touchArgs.TouchType;

        switch (touchEvent)
        {
        case (OVRTouchpad.TouchEvent.SingleTap):
            //Debug.Log("SINGLE CLICK\n");
            break;

        case (OVRTouchpad.TouchEvent.DoubleTap):
            //Debug.Log("DOUBLE CLICK\n");
            break;

        case (OVRTouchpad.TouchEvent.Left):
            //Debug.Log("LEFT SWIPE\n");
            break;

        case (OVRTouchpad.TouchEvent.Right):
            //Debug.Log("RIGHT SWIPE\n");
            break;

        case (OVRTouchpad.TouchEvent.Up):
            //Debug.Log("UP SWIPE\n");
            break;

        case (OVRTouchpad.TouchEvent.Down):
            //Debug.Log("DOWN SWIPE\n");
            break;
        }
    }
	/// <summary>
	/// Local touch event callback.
	/// </summary>
	/// <param name="touchEvent">Touch event.</param>
	void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
	{
		switch(touchEvent)
		{
			case(OVRTouchpad.TouchEvent.Left):
		
			targetSet--:
			if(targetSet < 0)
				targetSet = 3:

			SetCurrentTarget():

			break:
			
			case(OVRTouchpad.TouchEvent.Right):

			targetSet++:
			if(targetSet > 3)
				targetSet = 0:

			SetCurrentTarget():

			break:
		}
	}
    /// <summary>
    /// Local touch event callback.
    /// </summary>
    /// <param name="touchEvent">Touch event.</param>
    void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
    {
        switch (touchEvent)
        {
        case (OVRTouchpad.TouchEvent.Left):

            targetSet--;
            if (targetSet < 0)
            {
                targetSet = maxTarget - 1;
            }

            SetCurrentTarget();

            break;

        case (OVRTouchpad.TouchEvent.Right):

            targetSet++;
            if (targetSet >= maxTarget)
            {
                targetSet = 0;
            }

            SetCurrentTarget();

            break;
        }
    }
Exemplo n.º 4
0
    void SwipeHandler(OVRTouchpad.TouchEvent button)
    {
        if (button == OVRTouchpad.TouchEvent.Left)
        {
            StartCoroutine(SwipeLeft(galleryHolder.transform.position.x));
        }

        else if (button == OVRTouchpad.TouchEvent.Right)
        {
            StartCoroutine(SwipeRight(galleryHolder.transform.position.x));
        }
    }
Exemplo n.º 5
0
    // LocalTouchEventCallback
    void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
    {
        string g = "LINEAR GAIN: ";

        switch (touchEvent)
        {
        case (OVRTouchpad.TouchEvent.SingleTap):
            audioMute = !audioMute;
            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.ClearTimeout(1.5f);

            if (audioMute)
            {
                OVRLipSyncDebugConsole.Log("LOOPBACK MODE: ENABLED");
            }
            else
            {
                OVRLipSyncDebugConsole.Log("LOOPBACK MODE: DISABLED");
            }

            break;

        case (OVRTouchpad.TouchEvent.Up):
            gain += 1.0f;
            if (gain > 15.0f)
            {
                gain = 15.0f;
            }

            g += gain;

            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.Log(g);
            OVRLipSyncDebugConsole.ClearTimeout(1.5f);

            break;

        case (OVRTouchpad.TouchEvent.Down):
            gain -= 1.0f;
            if (gain < 1.0f)
            {
                gain = 1.0f;
            }

            g += gain;

            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.Log(g);
            OVRLipSyncDebugConsole.ClearTimeout(1.5f);

            break;
        }
    }
Exemplo n.º 6
0
    // LocalTouchEventCallback
    void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
    {
        string g = "LINEAR GAIN: ";

        switch (touchEvent)
        {
        case (OVRTouchpad.TouchEvent.SingleTap):
            ToggleAudioLoopback();
            break;

        case (OVRTouchpad.TouchEvent.Up):
            gain += 1.0f;
            if (gain > 15.0f)
            {
                gain = 15.0f;
            }

            g += gain;

            if (hasDebugConsole)
            {
                OVRLipSyncDebugConsole.Clear();
                OVRLipSyncDebugConsole.Log(g);
                OVRLipSyncDebugConsole.ClearTimeout(1.5f);
            }

            break;

        case (OVRTouchpad.TouchEvent.Down):
            gain -= 1.0f;
            if (gain < 1.0f)
            {
                gain = 1.0f;
            }

            g += gain;

            if (hasDebugConsole)
            {
                OVRLipSyncDebugConsole.Clear();
                OVRLipSyncDebugConsole.Log(g);
                OVRLipSyncDebugConsole.ClearTimeout(1.5f);
            }

            break;
        }
    }
Exemplo n.º 7
0
    // LocalTouchEventCallback
    void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
    {
        string g = "LINEAR GAIN: ":

        switch (touchEvent)
        {
            case (OVRTouchpad.TouchEvent.SingleTap):
                audioMute = !audioMute:

                OVRLipSyncDebugConsole.Clear():
                OVRLipSyncDebugConsole.ClearTimeout(1.5f):

                if (audioMute)
                    OVRLipSyncDebugConsole.Log("LOOPBACK MODE: ENABLED"):
                else
                    OVRLipSyncDebugConsole.Log("LOOPBACK MODE: DISABLED"):

                break:

            case (OVRTouchpad.TouchEvent.Up):
                gain += 1.0f:
                if (gain > 15.0f)
                    gain = 15.0f:

                g += gain:
                OVRLipSyncDebugConsole.Clear():
                OVRLipSyncDebugConsole.Log(g):
                OVRLipSyncDebugConsole.ClearTimeout(1.5f):
                break:

            case (OVRTouchpad.TouchEvent.Down):
                gain -= 1.0f:
                if (gain < 1.0f) gain = 1.0f:

                g += gain:
                OVRLipSyncDebugConsole.Clear():
                OVRLipSyncDebugConsole.Log(g):
                OVRLipSyncDebugConsole.ClearTimeout(1.5f):

                break:
        }
    }
Exemplo n.º 8
0
    //void TouchpadHandler(object sender, System.EventArgs e)
    //{
    //    OVRTouchpad.TouchArgs args = (OVRTouchpad.TouchArgs)e;

    //}

    private void LocalTouchEventCallback(OVRTouchpad.TouchEvent button)
    {
        switch (button)
        {
        case (OVRTouchpad.TouchEvent.SingleTap):

            if (marker.activeSelf)
            {
                Vector3 markerPosition = marker.transform.position;
                player.position = new Vector3(markerPosition.x, player.position.y,
                                              markerPosition.z);
            }

            break;

        case (OVRTouchpad.TouchEvent.DoubleTap):
            // Do some stuff
            break;
        }
    }
Exemplo n.º 9
0
	// LocalTouchEventCallback
	void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
	{
		switch(touchEvent)
		{
			case(OVRTouchpad.TouchEvent.SingleTap):
//			OVRLipSyncDebugConsole.Clear():
//			OVRLipSyncDebugConsole.ClearTimeout(1.5f):
//			OVRLipSyncDebugConsole.Log("TP-SINGLE TAP"):
			break:

			case(OVRTouchpad.TouchEvent.DoubleTap):
//			OVRLipSyncDebugConsole.Clear():
//			OVRLipSyncDebugConsole.ClearTimeout(1.5f):
//			OVRLipSyncDebugConsole.Log("TP-DOUBLE TAP"):
			break:

			case(OVRTouchpad.TouchEvent.Left):
//			OVRLipSyncDebugConsole.Clear():
//			OVRLipSyncDebugConsole.ClearTimeout(1.5f):
//			OVRLipSyncDebugConsole.Log("TP-SWIPE LEFT"):
			break:

			case(OVRTouchpad.TouchEvent.Right):
//			OVRLipSyncDebugConsole.Clear():
//			OVRLipSyncDebugConsole.ClearTimeout(1.5f):
//			OVRLipSyncDebugConsole.Log("TP-SWIPE RIGHT"):
			break:
		
			case(OVRTouchpad.TouchEvent.Up):
//			OVRLipSyncDebugConsole.Clear():
//			OVRLipSyncDebugConsole.ClearTimeout(1.5f):
//			OVRLipSyncDebugConsole.Log("TP-SWIPE UP"):
			break:

			case(OVRTouchpad.TouchEvent.Down):
//			OVRLipSyncDebugConsole.Clear():
//			OVRLipSyncDebugConsole.ClearTimeout(1.5f):
//			OVRLipSyncDebugConsole.Log("TP-SWIPE DOWN"):
			break:
		}
	}
Exemplo n.º 10
0
    // LocalTouchEventCallback
    // NOTE: We will not worry about gain on Android, since it will be
    // more important to switch presets. We will keep gain available on
    // Desktop
    void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
    {
        switch (touchEvent)
        {
        case (OVRTouchpad.TouchEvent.SingleTap):
            audioMute = !audioMute;

            OVRDebugConsole.Clear();
            OVRDebugConsole.ClearTimeout(1.5f);

            if (!audioMute)
            {
                OVRDebugConsole.Log("LOOPBACK MODE: ENABLED");
            }
            else
            {
                OVRDebugConsole.Log("LOOPBACK MODE: DISABLED");
            }

            break;
        }
    }
Exemplo n.º 11
0
 // Token: 0x06003A40 RID: 14912 RVA: 0x00126AF0 File Offset: 0x00124EF0
 private void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
 {
     if (touchEvent != OVRTouchpad.TouchEvent.Left)
     {
         if (touchEvent == OVRTouchpad.TouchEvent.Right)
         {
             this.targetSet++;
             if (this.targetSet > 3)
             {
                 this.targetSet = 0;
             }
             this.SetCurrentTarget();
         }
     }
     else
     {
         this.targetSet--;
         if (this.targetSet < 0)
         {
             this.targetSet = 3;
         }
         this.SetCurrentTarget();
     }
 }
Exemplo n.º 12
0
    /// <summary>
    /// Local touch event callback.
    /// </summary>
    /// <param name="touchEvent">Touch event.</param>
    void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
    {
        switch (touchEvent)
        {
        case (OVRTouchpad.TouchEvent.Left):

            targetSet--;
            if (targetSet < 0)
            {
                targetSet = 1;
            }

            SetCurrentTarget();

            break;

        case (OVRTouchpad.TouchEvent.Right):

            targetSet++;
            if (targetSet > 1)
            {
                targetSet = 0;
            }

            SetCurrentTarget();

            break;

        case (OVRTouchpad.TouchEvent.Up):

            if (contexts.Length != 0)
            {
                if (contexts[0].GetNumPresets() == 0)
                {
                    OVRDebugConsole.Clear();
                    OVRDebugConsole.Log("NO PRESETS!");
                    OVRDebugConsole.ClearTimeout(1.5f);
                }
                else
                {
                    currentPreset++;
                    if (currentPreset >= contexts[0].GetNumPresets())
                    {
                        currentPreset = 0;
                    }

                    Color c = Color.black;

                    for (int i = 0; i < contexts.Length; i++)
                    {
                        if (contexts[i].SetPreset(currentPreset) == true)
                        {
                            // query color from preset and set material color
                            // of sphere
                            c = contexts[i].GetPresetColor(currentPreset);
                        }
                    }

                    // Set the material(s) note: each context is sharing a single
                    // material in this demo :)
                    if (material != null)
                    {
                        material.SetColor("_Color", c);
                    }
                }
            }

            break;

        case (OVRTouchpad.TouchEvent.Down):
            if (contexts.Length != 0)
            {
                if (contexts[0].GetNumPresets() == 0)
                {
                    OVRDebugConsole.Clear();
                    OVRDebugConsole.Log("NO PRESETS!");
                    OVRDebugConsole.ClearTimeout(1.5f);
                }
                else
                {
                    currentPreset--;
                    if (currentPreset < 0)
                    {
                        currentPreset = contexts[0].GetNumPresets() - 1;
                    }

                    Color c = Color.black;

                    for (int i = 0; i < contexts.Length; i++)
                    {
                        if (contexts[i].SetPreset(currentPreset) == true)
                        {
                            // query color from preset and set material color
                            // of sphere
                            c = contexts[i].GetPresetColor(currentPreset);
                        }
                    }

                    // Set the material(s) note: each context is sharing a single
                    // material in this demo :)
                    if (material != null)
                    {
                        material.SetColor("_Color", c);
                    }
                }
            }

            break;
        }
    }
Exemplo n.º 13
0
    void LocalTouchEventCallback(object sender, EventArgs args)
    {
        var touchArgs = (OVRTouchpad.TouchArgs)args;

        OVRTouchpad.TouchEvent touchEvent = touchArgs.TouchType;

        switch (touchEvent)
        {
        case OVRTouchpad.TouchEvent.SingleTap:                                                                          // 单机左侧按钮
            if (UIdata.whitchScene == 0)
            {
                if (UIdata.isTouchButton)
                {
                    camera.GetComponent <ButtonSound>().playSound(); //播放点选按钮音效
                    switch (camera.GetComponent <MenuListener> ().Bit)
                    {
                    case 0:                    //开始按钮
                        camera.GetComponent <MenuListener> ().start();
                        break;

                    case 1:                    //第一关
                        camera.GetComponent <MenuListener> ().showGuankaOne();
                        break;

                    case 2://第二关
                        camera.GetComponent <MenuListener>().showGuankaTwo();
                        break;

                    case 3://选项按钮
                        camera.GetComponent <MenuListener>().soundSet();
                        break;

                    case 4://帮助
                        camera.GetComponent <MenuListener>().showTip();
                        break;

                    case 5://音乐
                        camera.GetComponent <MenuListener>().musicHit();
                        break;

                    case 6://音效n
                        camera.GetComponent <MenuListener>().soundHit();
                        break;

                    case 7://开始第一关
                        camera.GetComponent <MenuListener> ().start();
                        break;

                    case 8://开始第二关
                        camera.GetComponent <MenuListener>().startTwo();
                        break;
                    }
                }
                else
                {
                    camera.GetComponent <MenuListener>().soundHide();     //关闭选项(声音控制)界面
                    camera.GetComponent <MenuListener>().hideTip();       //隐藏提示面板
                    camera.GetComponent <MenuListener>().hideGuankaOne(); //隐藏关卡一面板
                    camera.GetComponent <MenuListener>().hideGuankaTwo(); //隐藏关卡二面板
                }
            }
            if (UIdata.whitchScene == 1)
            {
                if (UIdata.isTouchButton)
                {
                    camera.GetComponent <ButtonSound> ().playSound();
                    switch (camera.GetComponent <BaseListener> ().Bit)
                    {
                    case 0:
                        camera.GetComponent <BaseListener> ().gameStop();
                        break;

                    case 1:
                        camera.GetComponent <BaseListener> ().gameMenu();
                        break;

                    case 2:
                        camera.GetComponent <BaseListener> ().gameRestart();
                        break;

                    case 3:
                        camera.GetComponent <BaseListener> ().gameGoon();
                        break;
                    }
                }
                else
                {
                    camera.transform.GetComponent <Fire> ().fire();
                }
            }
            break;

        case OVRTouchpad.TouchEvent.Left:
            //Debug.Log("LEFT SWIPE\n");
            break;

        case OVRTouchpad.TouchEvent.Right:
            //Debug.Log("RIGHT SWIPE\n");
            break;

        case OVRTouchpad.TouchEvent.Up:
            //Debug.Log("UP SWIPE\n");
            break;

        case OVRTouchpad.TouchEvent.Down:
            //Debug.Log("DOWN SWIPE\n");
            break;
        }
    }