File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Assets/HoloToolkit-Examples/MotionControllers-GrabMechanics/Scripts Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ protected virtual void StartGrab(BaseGrabber grabber)
158158
159159 // Attach ourselves to this grabber
160160 AttachToGrabber ( grabber ) ;
161-
161+
162162 if ( OnGrabbed != null )
163163 OnGrabbed ( this ) ;
164164 }
@@ -221,7 +221,19 @@ protected virtual void OnGrabStay()
221221 /// </summary>
222222 protected Stack < BaseGrabber > activeGrabbers = new Stack < BaseGrabber > ( ) ;
223223
224+ protected virtual void Update ( )
225+ {
226+ if ( prevGrabState != GrabState && OnGrabStateChange != null )
227+ OnGrabStateChange ( this ) ;
228+
229+ if ( prevContactState != ContactState && OnContactStateChange != null )
230+ OnContactStateChange ( this ) ;
231+
232+ prevGrabState = GrabState ;
233+ prevContactState = ContactState ;
234+ }
235+
224236 private GrabStateEnum prevGrabState = GrabStateEnum . Inactive ;
225- private GrabStateEnum prevHoverState = GrabStateEnum . Inactive ;
237+ private GrabStateEnum prevContactState = GrabStateEnum . Inactive ;
226238 }
227239}
You can’t perform that action at this time.
0 commit comments