/// <summary> /// Change the base color of the current query target based on the given color. /// </summary> /// <param name="color">Highlight tint</param> private void HighlightTarget(Color color) { Renderer[] renderers = CurrentTarget.GetComponents <Renderer>(); if ((renderers.Length > 0) && (renderers[0].materials.Length > 0)) { renderers[0].materials[0].color = color; } }
/// <summary> /// Save the original base color of the target (before changing it for highlighting). /// </summary> private void SaveOriginalColors() { if ((CurrentTargetIsValid) && (originalColor == new Color(0, 0, 0, 0))) { Renderer[] renderers = CurrentTarget.GetComponents <Renderer>(); if ((renderers.Length > 0) && (renderers[0].materials.Length > 0)) { originalColor = renderers[0].materials[0].color; } } }