public virtual void HighlightControllerElement(GameObject element, Color?highlight, float fadeDuration = 0f) { if (!base.enabled) { return; } VRTK_SharedMethods.HighlightObject(element, highlight, fadeDuration); }
/// <summary> /// The HighlightElement method attempts to highlight a specific controller element. /// </summary> /// <param name="elementType">The element type on the controller.</param> /// <param name="color">The colour to highlight the controller element to.</param> /// <param name="fadeDuration">The duration in time to fade from the initial colour to the target colour.</param> public virtual void HighlightElement(SDK_BaseController.ControllerElements elementType, Color color, float fadeDuration = 0f) { Transform element = GetElementTransform(GetPathForControllerElement(elementType)); if (element != null) { VRTK_SharedMethods.HighlightObject(element.gameObject, color, fadeDuration); SetColourParameter(elementType, color); } }
public virtual void ToggleHighlightControllerElement(bool state, GameObject element, Color?highlight = null, float duration = 0f) { if (element) { if (state) { VRTK_SharedMethods.HighlightObject(element, (highlight != null) ? highlight : new Color?(Color.white), duration); return; } VRTK_SharedMethods.UnhighlightObject(element); } }
protected virtual void ToggleHighlightAlias(bool state, string transformPath, Color?highlight, float duration = 0f) { Transform element = GetElementTransform(transformPath); if (element) { if (state) { VRTK_SharedMethods.HighlightObject(element.gameObject, (highlight != null ? highlight : Color.white), duration); } else { VRTK_SharedMethods.UnhighlightObject(element.gameObject); } } }