https://github.com/terrehbyte/moregizmos
Additional debug gizmos to draw at editor-time in Unity projects.
https://github.com/terrehbyte/moregizmos
unity unity-package-manager upm
Last synced: 8 months ago
JSON representation
Additional debug gizmos to draw at editor-time in Unity projects.
- Host: GitHub
- URL: https://github.com/terrehbyte/moregizmos
- Owner: terrehbyte
- License: mit
- Created: 2019-02-17T06:02:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-28T00:36:43.000Z (about 6 years ago)
- Last Synced: 2025-09-12T07:50:27.056Z (9 months ago)
- Topics: unity, unity-package-manager, upm
- Language: C#
- Homepage: https://twitter.com/terrehbyte/status/1046116786410741760
- Size: 37.1 KB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MoreGizmos

A proof-of-concept-quality library for Unity 2018.4+ that expands the number of
debug gizmos that can be drawn.
Here's what you'd have available with Unity's offerings and this library:
- [UnityEngine.Gizmos](https://docs.unity3d.com/ScriptReference/Gizmos.html) - usable in OnDrawGizmos, editor-only
- DrawCube
- DrawFrustum
- DrawGUITexture
- DrawIcon
- DrawLine
- DrawMesh
- DrawRay
- DrawSphere
- DrawWireCube
- DrawWireMesh
- DrawWireSphere
- [UnityEngine.Debug](https://docs.unity3d.com/ScriptReference/Debug.html) - usable anywhere, editor-only
- DrawRay
- DrawLine
- MoreGizmos.GizmosEx - usable anywhere, editor-only (for now)
- DrawSphere
- DrawCube
- DrawCircle
- DrawSquare
- DrawCustomGizmo - accepts objects of type `GizmoDraw`
These are intended to be only drawn during editor-time by collecting and
delegating the drawing of said debug gizmos to an instance of `GizmosEx` which
in turn renders them in its own `OnDrawGizmos` message.
Custom gizmos types can be derived from `GizmoDraw` and implement the required
methods that will be called to prepare and render the gizmo.
## Installation
MoreGizmos is distributed as a package that can be managed through Unity's
Package Manager UI as of 2018.1.
### 2018.3+
To add this to an existing Unity project, open your project's `manifest.json`
file in your `Packages` directory and add the following line to your list of
dependencies:
```json
"dependencies": {
"com.tb.moregizmos": "https://github.com/terrehbyte/MoreGizmos.git",
}
```
Note that the trailing comma should be omitted if you add it as the last element
in the list, of course. For more information or advanced usage, refer to the
Unity Manual for [specifying dependencies via Git URLs][unityManUPMGit].
[unityManUPMGit]:https://docs.unity3d.com/Manual/upm-git.html
### Pre-2018.3
Support for loading Git repositories as a package was only added in 2018.3, so
you'll need to resort to local file management if you're running something older.

Unity allows you to add a package by providing a relative file path to a
package.json file. Best practices would advise that you place it somewhere
co-located with your Unity project (and versioned, of course).
### No Package Manager
Alternatively, you may choose to download this project as a zip (or submodule if
you're using Git) whose contents can be placed in the `Assets` directory of
your project. The end-result should be: `ProjectRoot/Packages/`
as a built-in package.
## Quick Usage
Attach an instance of `GizmosEx` to a GameObject in the scene. After doing so,
try adding something to the effect of the following code:
```c#
public class ExampleUsage : MonoBehaviour
{
private void Update()
{
// draws a RED CUBE at 0,0,0, with a scale of ONE for each dimension
GizmosEx.DrawCube(Vector3.zero, Vector3.one, Color.red);
}
}
```
## License
Copyright (c) 2019-2020 Terry Nguyen - MIT License
The sprites used in the above GIF are CC0-licensed from [Buch][buch]'s dungeon
tileset.
[buch]:https://opengameart.org/users/buch
More information can be found by reading the [LICENSE](LICENSE.md) file in this
repository.