Created
September 5, 2016 15:37
-
-
Save takoyakiroom/c94c5adc520774932d965a98ac7fb5df to your computer and use it in GitHub Desktop.
コントローラリスナ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using VRTK; | |
public class CtrlListener : MonoBehaviour { | |
void Start() | |
{ | |
// 爆弾置くボタン | |
GetComponent<VRTK_ControllerEvents>().TriggerReleased += new ControllerInteractionEventHandler(DoTriggerReleased); | |
} | |
void Update () { | |
} | |
void DoTriggerReleased(object sender, ControllerInteractionEventArgs e) | |
{ | |
Vector3 pos = transform.position; | |
Maze maze = GameObject.Find("Maze").GetComponent<Maze>(); | |
// 爆弾置く | |
maze.PutBomb(pos); | |
Debug.Log("controllerIndex:"+ e.controllerIndex+ " buttonPressure:"+ e.buttonPressure + " touchpadAxis:x,y=" + e.touchpadAxis.x + "," + e.touchpadAxis.y + " touchpadAngle:" + e.touchpadAngle); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment