A collection of functions that imitate Unity's gizmo functionality using transforms and meshes.
Unity 2020.1.4f1 Universal Render Pipeline
C#
- Add Mesh Gizmos Container prefab to your scene.
- From your script, find MeshGizmos instance with MeshGizmos.Instance. (eg. var _Gizmos = MeshGizmos.Instance;)
- Use instance to call each gizmo as you would with regurlar gizmo calls. (eg. _Gizmos.DrawLine(Vector3.zero, Vector3.one, Color.yellow);) Does not need to be in OnDrawGizmos().
- If you would like to use your own material then you can add it to the Material reference in Mesh Gizmos Container prefab.
For use with HDRP some extra steps are needed.
- Find gizmo material
- Select shader tab ->HDRP -> Lit
See ExampleGizmoCalls.cs for usage examples.
Example solar system scene with bodies showing the gravitational force (red) excerted on them and their velocities (blue).
Distributed under the MIT License. See LICENSE for more information.
Project Link: Mesh-Gizmos