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.
Runtime Gizmos are simply referred as gizmos through this text
Here are several simple steps to get started with gizmos:
- Create Cube Create->3D Object->Cube
- Select Cube.
- Add Assets/Battlehub/RTGizmos/BoxColliderGizmo component.
- Hit Play.
- Use mouse left-click + drag to resize Box Collider Gizmo.
- Observe that
Sizeproperties of Box Collider were changed.
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;
Located in Assets/Battlehub/RTGizmos/Scripts/BoxGizmo.cs.
Base class for all gizmos that have box shape:
Located in Assets/Battlehub/RTGizmos/Scripts/SphereGizmo.cs.
Base class for all gizmos that have sphere shape:
Located in Assets/Battlehub/RTGizmos/Scripts/CapsuleGizmo.cs.
Base class for all gizmos that have capsule shape:
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:
- Create Game Object with Box Collider.
- Add Box Collider Gizmo component.
Sphere Collider Gizmo
Located in Assets/Battlehub/RTGizmos/Scripts/SphereColliderGizmo.cs.
Sphere Collider Gizmo could be added to object with Sphere Collider:
- Create Game Object with Sphere Collider.
- Add Sphere Collider Gizmo component.
Capsule Collider Gizmo
Located in Assets/Battlehub/RTGizmos/Scripts/CapsuleColliderGizmo.cs.
Capsule Collider Gizmo could be added to object with Capsule Collider:
- Create Game Object with Capsule Collider.
- Add Capsule Collider Gizmo component.
Point Light Gizmo
Located in Assets/Battlehub/RTGizmos/Scripts/PointLightGizmo.cs.
Point Light Gizmo could be added to Point Light:
- Create Point Light.
- Add LightGizmo component.
Spot Light Gizmo
Located in Assets/Battlehub/RTGizmos/Scripts/SpotLightGizmo.cs.
Spot Light Gizmo could be added to Spot Light:
- Create Spot Light.
- Add LightGizmo component.
Directional Light Gizmo
Located in Assets/Battlehub/RTGizmos/Scripts/DirectionalLightGizmo.cs. Directional Light Gizmo could be added to Directional Light
- Create Directional Light.
- Add Light Gizmo component.
Audio Source Gizmo
Located in Assets/Battlehub/RTGizmos/Scripts/AudioSourceGizmo.cs.
Audio Source Gizmo could be added to Audio Source
- Create Audio Source.
- Add Audio Source Gizmo component.
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
- Create GameObject with SkinnedMeshRenderer.
- Add Skinned Mesh Renderer Gizmo component.