Created
April 11, 2017 23:53
-
-
Save benmcnelly/dde445a802c1ef49c2dde3ee504c4ed2 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 VRTK; | |
public class theRealDonaldTrump : MonoBehaviour { | |
void Start () | |
{ | |
//Does the thing being grabbed ( Mexican ) have the interactable object VRTK script attached... | |
if (GetComponent<VRTK_InteractableObject>() == null) | |
{ | |
Debug.LogError("You can't grab this, it has obtained legal citizenship, also needs VRTK_InteractableObject script attached to it"); | |
return; | |
} | |
//subscribe to the event.... | |
GetComponent<VRTK_InteractableObject>().InteractableObjectGrabbed += new InteractableObjectEventHandler(ObjectGrabbed); | |
} | |
//this object has been grabbed.. Lets deport this.. | |
private void ObjectGrabbed(object sender, InteractableObjectEventArgs e) | |
{ | |
Debug.Log("Target got grabbed!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment