SelectionHelpers
ComponentExists
Selected GameObjects contain a component type.
void OnDrawGizmos() {
if (SelectionHelpers.ComponentExists<IDebug>()) {
// Draw Gizmos if a "IDebug" component is selected
}
}
Contains
Selected GameObjects contain a GameObject or MonoBehaviour
void OnDrawGizmos() {
if (SelectionHelpers.Contains(MyComponent)) {
// Draw Gizmos if "MyComponent" is selected
}
}