-
Notifications
You must be signed in to change notification settings - Fork 0
Extending Behviour
Jon McCreadie edited this page Oct 16, 2024
·
3 revisions
Any calls to GizmoDrawer in runtime scripts should be enclosed in #if UNITY_EDITOR tags to avoid errors in builds.
Consider using UnityEvents as the broadcaster does not store a reference to the script listening, nothing will break in builds.
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.
| 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. |