Conditionally showing virtual joysticks on iOS vs Editor

I’m trying to conditionally show virtual joysticks only when running on an iOS device, and use keys instead in the Editor on my laptop.

I tried the following, and in MonoDevelop the #else clause is dimmed out and I’m not seeing the virtual joysticks on iOS.

#if UNITY_EDITOR
leftJoystick.SetActive(false);
rightScreenTap.SetActive(false);
#else
leftJoystick.SetActive(true);
rightScreenTap.SetActive(true);
#endif

Does anyone know the correct way to do this ?

Thanks

in MonoDevelop the #else clause is dimmed out and I’m not seeing the virtual joysticks on iOS.

The #else block will be dimmed because you are in the Editor when writing the scripts. Place a Debug.Log inside the #else block, build & run for iOS, and look for it in the Xcode console. That will tell you if that block is being executed, maybe your method is not being called at all. Or use WIFI debugging to look for the problem:

http://docs.unity3d.com/412/Documentation/Manual/Debugger.html