What is a Gizmo?

In RLD a Gizmo is the equivalent of Unity's GameObject. On its own it doesn't do much, but each gizmo instance can have gizmo behaviours attached to define the appearance and beahviour of that gizmo.

A gizmo is composed of the following:

Object Selection Gizmo Ids

This is the list of ids that are used to identify the different gizmos that can be used to manipulate selected objects:

  • MoveGizmo;
  • RotationGizmo;
  • ScaleGizmo;
  • BoxScaleGizmo;
  • UniversalGizmo;
  • ExtrudeGizmo;

These ids are defined as integers inside a class called ObjectSelectionGizmoId. This is a static class and each id can be accessed via a static integer property. The class is defined in the following file: Assets\Runtime Level Design\Scripts\Selection\ObjectSelectionGizmoId.cs

Accessing Object Selection Gizmos

You can retreive a reference to a gizmo using it's id by writing the following code:

Gizmo moveGizmo = RTObjectSelectionGizmos.Get.GetGizmoById(ObjectSelectionGizmoId.MoveGizmo);
Gizmo rotationGizmo = RTObjectSelectionGizmos.Get.GetGizmoById(ObjectSelectionGizmoId.RotationGizmo);
Gizmo scaleGizmo = RTObjectSelectionGizmos.Get.GetGizmoById(ObjectSelectionGizmoId.ScaleGizmo);
Gizmo boxScaleGizmo = RTObjectSelectionGizmos.Get.GetGizmoById(ObjectSelectionGizmoId.BoxScaleGizmo);
Gizmo universalGizmo = RTObjectSelectionGizmos.Get.GetGizmoById(ObjectSelectionGizmoId.UniversalGizmo);
Gizmo extrudeGizmo = RTObjectSelectionGizmos.Get.GetGizmoById(ObjectSelectionGizmoId.ExtrudeGizmo);

You can also retrieve all the gizmos at once by writing:

List<Gizmo> allGizmos = RTObjectSelectionGizmos.Get.GetAllGizmos();

Getting a Gizmo's Id

If you have a reference to a gizmo, you can get its id by writing:

int gizmoId = RTObjectSelectionGizmos.Get.GetGizmoId(gizmo);

The GetGizmoId function returns ObjectSelectionGizmoId.None if the gizmo is not an object selection gizmo.