Skip to content

Commit fc66151

Browse files
Had to wrap in UNITY_EDITOR to build
1 parent 2f013e7 commit fc66151

File tree

1 file changed

+12
-13
lines changed
  • Assets/HoloToolkit-Examples/MotionControllers-GrabMechanics/Scripts

1 file changed

+12
-13
lines changed

Assets/HoloToolkit-Examples/MotionControllers-GrabMechanics/Scripts/BaseGrabber.cs

+12-13
Original file line numberDiff line numberDiff line change
@@ -191,25 +191,24 @@ protected virtual void SortAvailable()
191191

192192
void Update()
193193
{
194-
if (Application.isEditor)
194+
#if UNITY_EDITOR
195+
if (UnityEditor.Selection.activeGameObject == gameObject)
195196
{
196-
if (UnityEditor.Selection.activeGameObject == gameObject)
197+
if (Input.GetKeyDown(KeyCode.G))
197198
{
198-
if (Input.GetKeyDown(KeyCode.G))
199+
if (GrabState == GrabStateEnum.Inactive)
199200
{
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();
210208
}
211209
}
212210
}
211+
#endif
213212

214213
if (prevGrabState != GrabState && OnGrabStateChange != null)
215214
{

0 commit comments

Comments
 (0)