File tree 1 file changed +12
-13
lines changed
Assets/HoloToolkit-Examples/MotionControllers-GrabMechanics/Scripts
1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -191,25 +191,24 @@ protected virtual void SortAvailable()
191
191
192
192
void Update ( )
193
193
{
194
- if ( Application . isEditor )
194
+ #if UNITY_EDITOR
195
+ if ( UnityEditor . Selection . activeGameObject == gameObject )
195
196
{
196
- if ( UnityEditor . Selection . activeGameObject == gameObject )
197
+ if ( Input . GetKeyDown ( KeyCode . G ) )
197
198
{
198
- if ( Input . GetKeyDown ( KeyCode . G ) )
199
+ if ( GrabState == GrabStateEnum . Inactive )
199
200
{
200
- if ( GrabState == GrabStateEnum . Inactive )
201
- {
202
- Debug . Log ( "Grab start" ) ;
203
- GrabStart ( ) ;
204
- }
205
- else
206
- {
207
- Debug . Log ( "Grab end" ) ;
208
- GrabEnd ( ) ;
209
- }
201
+ Debug . Log ( "Grab start" ) ;
202
+ GrabStart ( ) ;
203
+ }
204
+ else
205
+ {
206
+ Debug . Log ( "Grab end" ) ;
207
+ GrabEnd ( ) ;
210
208
}
211
209
}
212
210
}
211
+ #endif
213
212
214
213
if ( prevGrabState != GrabState && OnGrabStateChange != null )
215
214
{
You can’t perform that action at this time.
0 commit comments