Skip to content

Extending Behviour

Jon McCreadie edited this page Oct 16, 2024 · 3 revisions

Runtime calls

Any calls to GizmoDrawer in runtime scripts should be enclosed in #if UNITY_EDITOR tags to avoid errors in builds.

One Time Tasks

Consider using UnityEvents as the broadcaster does not store a reference to the script listening, nothing will break in builds.

Advanced Tasks

Consider abstracting managing gizmos to a single class enclosed in #if UNITY_EDITOR tags and isolate any runtime calls to the manager in the same way.

Public Methods

Type Name Result
void SetColor(Color) Set the gizmos color by passing a Unity Color object to this method.
Does not work with Unity Events!
void SetColor(string) Set the color by passing a valid color hex code as a string.

Clone this wiki locally