Skip to content

Instantly share code, notes, and snippets.

@takoyakiroom
Created September 5, 2016 15:37
Show Gist options
  • Save takoyakiroom/c94c5adc520774932d965a98ac7fb5df to your computer and use it in GitHub Desktop.
Save takoyakiroom/c94c5adc520774932d965a98ac7fb5df to your computer and use it in GitHub Desktop.
コントローラリスナ
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