Created
September 28, 2019 02:42
-
-
Save ssshake/3d75b7c063e44759f1ff6553c883f937 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//Adding this here because I couldn't figure out how to tell my grabble items in a game world when it's been grabbed | |
//so that it could do something on grab or release. Such as play a sound effect. | |
// | |
//After a lot of document searching I was surprised that I couldn't find what I was looking for. | |
// | |
//This extends OVRGrabble from the Oculus Unity SDK. | |
//You override methods called on grab | |
//You do your custom work | |
//You then pass the attributes on to OVRGrabble because it still needs these to do its own piece of work | |
using UnityEngine; | |
namespace Daggasoft | |
{ | |
public abstract class DaggasoftGrabbable : OVRGrabbable | |
{ | |
override public void GrabBegin(OVRGrabber hand, Collider grabPoint) | |
{ | |
Debug.Log("DAGGASOFT: GRAB BEGIN"); | |
//Your code goes here | |
base.GrabBegin(hand, grabPoint); //pass attributes down to Super | |
} | |
override public void GrabEnd(Vector3 linearVelocity, Vector3 angularVelocity) | |
{ | |
Debug.Log("DAGGASOFT: GRAB END"); | |
//Your code goes here | |
base.GrabEnd(linearVelocity, angularVelocity); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment