Gizmos Docs

Overview

Runtime Gizmos are the runtime 3D controls that are used to manipulate items in the scene. Unlike transform handles, gizmos does not modify transformation of objects. They are used to modify colliders, bounding boxes and properties of light and audio sources instead. All gizmos, their base classes, rendering classes and shaders can be found in Assets/Battlehub/RTGizmos folder.

Note

Runtime Gizmos are simply referred as gizmos through this text

Getting Started

Here are several simple steps to get started with gizmos:

  1. Create Cube Create->3D Object->Cube
  2. Select Cube.
  3. Add Assets/Battlehub/RTGizmos/BoxColliderGizmo component.
  4. Hit Play.
  5. Use mouse left-click + drag to resize Box Collider Gizmo.
  6. Observe that Center and Size properties of Box Collider were changed.

Screenshot

Base Gizmo

Source code of Base Gizmo can be found in Assets/Battlehub/RTGizmos/Scripts/BaseGizmo.cs. This is the base class of Box Gizmo, Sphere Gizmo, Capsule Gizmo and Cone Gizmo. Therefore all these gizmos have following settings:

  • Grid Size – step size used in unit snapping mode (default: 1.0).
  • Line Color – color of line.
  • Handles Color – color of handle (small quad).
  • Selection Color – color of selected handle.
  • Enable Undo – if set to true then gizmo will write all changes to undo stack (default: true).
  • Unit Snap Key – key switching gizmo to unit snapping mode.
  • Target – reference to the target object;

Box Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/BoxGizmo.cs.
Base class for all gizmos that have box shape:

Sphere Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/SphereGizmo.cs.
Base class for all gizmos that have sphere shape:

Capsule Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/CapsuleGizmo.cs.
Base class for all gizmos that have capsule shape:

Cone Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/ConeGizmo.cs. Base class for all gizmos that have cone shape:

Box Collider Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/BoxColliderGizmo.cs.
Box Collider Gizmo could be added to object with Box Collider:

  1. Create Game Object with Box Collider.
  2. Add Box Collider Gizmo component.

Screenshot

Sphere Collider Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/SphereColliderGizmo.cs.
Sphere Collider Gizmo could be added to object with Sphere Collider:

  1. Create Game Object with Sphere Collider.
  2. Add Sphere Collider Gizmo component.

Screenshot

Capsule Collider Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/CapsuleColliderGizmo.cs.
Capsule Collider Gizmo could be added to object with Capsule Collider:

  1. Create Game Object with Capsule Collider.
  2. Add Capsule Collider Gizmo component.

Screenshot

Point Light Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/PointLightGizmo.cs.
Point Light Gizmo could be added to Point Light:

  1. Create Point Light.
  2. Add LightGizmo component.

Screenshot

Spot Light Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/SpotLightGizmo.cs.
Spot Light Gizmo could be added to Spot Light:

  1. Create Spot Light.
  2. Add LightGizmo component.

Screenshot

Directional Light Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/DirectionalLightGizmo.cs. Directional Light Gizmo could be added to Directional Light

  1. Create Directional Light.
  2. Add Light Gizmo component.

Screenshot

Audio Source Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/AudioSourceGizmo.cs.
Audio Source Gizmo could be added to Audio Source

  1. Create Audio Source.
  2. Add Audio Source Gizmo component.

Screenshot

Audio Reverb Zone Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/AudioReverbZoneGizmo.cs.
Same as AudioSouce Gizmo

Skinned Mesh Renderer Gizmo

Located in Assets/Battlehub/RTGizmos/Scripts/SkinnedMeshRendererGizmo.cs.
Skinned Mesh Renderer Gizmo could be added to object with SkinnedMesh

  1. Create GameObject with SkinnedMeshRenderer.
  2. Add Skinned Mesh Renderer Gizmo component.

Screenshot