Last active
September 15, 2020 07:16
-
-
Save takoyakiroom/a3c71513e9392c7d6bd8993679ba39b3 to your computer and use it in GitHub Desktop.
ColliderChanger
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
namespace Valve.VR.InteractionSystem | |
{ | |
public class ColliderChanger : MonoBehaviour | |
{ | |
private void OnHandHoverBegin(Hand hand) | |
{ | |
Debug.Log("OnHandHoverBegin:" + gameObject.name + "/handType:" + hand.handType); | |
//if(hand.handType == SteamVR_Input_Sources.RightHand) | |
//{ | |
// Debug.Log("OnHandHoverBegin:RightHand"); | |
//} | |
//else if (hand.handType == SteamVR_Input_Sources.LeftHand) | |
//{ | |
// Debug.Log("OnHandHoverBegin:LeftHand"); | |
//} | |
} | |
private void OnHandHoverEnd(Hand hand) | |
{ | |
Debug.Log("OnHandHoverEnd:" + gameObject.name + "/handType:" + hand.handType); | |
} | |
private void OnAttachedToHand(Hand hand) | |
{ | |
Debug.Log("OnAttachedToHand:" + gameObject.name + "/handType:" + hand.handType); | |
GetComponent<Collider>().isTrigger = true; | |
} | |
private void OnDetachedFromHand(Hand hand) | |
{ | |
Debug.Log("OnDetachedFromHand:" + gameObject.name + "/handType:" + hand.handType); | |
GetComponent<Collider>().isTrigger = false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment