It may sometimes be useful to temporarily disable the object selection module. You can do this by calling the RTObjectSelection.Get.SetEnabled function.

The example listed below shows a scenario in which this might prove to be useful. If you have a module that paints objects in the scene using a brush, you may want to switch between selecting objects and brush painting by enabling/disabling the correct modules.

if (Input.GetKeyDown(KeyCode.Alpha1))
{
    // Enter brush paint mode
    RTObjectSelection.Get.SetEnabled(false);
    MyObjectPaintModule.Get.SetEnabled(true);
}
else
if (Input.GetKeyDown(KeyCode.Alpha2))
{
    // Exit brush paint mode
    RTObjectSelection.Get.SetEnabled(true);
    MyObjectPaintModule.Get.SetEnabled(false);
}

Note

When you disable the selection module, any object manipulation sessions such as selection grab, object-to-object snapping or selection grid snap will be terminated. The active gizmo will also be temporarily disabled until the selection module is enabled again.

Note

DO NOT use RTObjectSelection.Get.gameObject.SetActive(false) to disable the selection system. The game object needs to always be active.