private void M_VRTKIO_InteractableObjectUngrabbed(object sender, InteractableObjectEventArgs e) { if (!m_isActivated) { return; } m_Highter.Highlight(Color.yellow); }
private void highlight() { if (_highlighter != null) { _highlighter.Highlight(HighlightColor); } }
protected virtual void ToggleHighlightColor() { if (Application.isPlaying && highlightAlwaysActive && !isSnapped && objectHighlighter != null) { objectHighlighter.Highlight((willSnap && validHighlightColor != Color.clear ? validHighlightColor : highlightColor)); } }
private void InitialiseHighlighter() { var existingHighlighter = Utilities.GetActiveHighlighter(gameObject); //If no highlighter is found on the GameObject then create the default one if (existingHighlighter == null) { highlightObject.AddComponent <VRTK_MaterialColorSwapHighlighter>(); } else { Utilities.CloneComponent(existingHighlighter, highlightObject); } //Initialise highlighter and set highlight colour objectHighlighter = highlightObject.GetComponent <VRTK_BaseHighlighter>(); objectHighlighter.Initialise(highlightColor); objectHighlighter.Highlight(highlightColor); //if the object highlighter is using a cloned object then disable the created highlight object's renderers if (objectHighlighter.UsesClonedObject()) { foreach (var renderer in GetComponentsInChildren <Renderer>(true)) { var check = renderer.GetComponent <VRTK_PlayerObject>(); if (!check || check.objectType != VRTK_PlayerObject.ObjectTypes.Highlighter) { renderer.enabled = false; } } } }
private void HighLight(Transform target, Color color) { VRTK_BaseHighlighter highlighter = (target != null ? target.GetComponent <VRTK_BaseHighlighter>() : null); if (highlighter != null) { highlighter.Initialise(); if (target.gameObject.tag == "1") { SceneManager.LoadScene(1); } if (target.gameObject.tag == "2") { SceneManager.LoadScene(0); } if (color != Color.clear) { highlighter.Highlight(color); } else { highlighter.Unhighlight(); } } }
//public override void StartUsing(VRTK_InteractUse currentUsingObject = null) //{ // base.StartUsing(currentUsingObject); // if (rotator == null) // rotator = GameObject.Find("TheCube").GetComponent<aa>(); // // rotator.Going = !rotator.Going; // rotator.visibility(); // myHighlight(); //} //public override void StopUsing(VRTK_InteractUse previousUsingObject = null, bool resetUsingObjectState = true) //{ // base.StopUsing(previousUsingObject, resetUsingObjectState); // if (rotator == null) // rotator = GameObject.Find("TheCube").GetComponent<aa>(); // // rotator.Going = !rotator.Going; // rotator.visibility(); // myHighlight(); //} protected void myHighlight() { VRTK_BaseHighlighter highligher = transform.GetComponentInChildren <VRTK_BaseHighlighter>(); highligher.Initialise(); highligher.Highlight(Color.yellow); }
private void ToggleHighlight(Transform target, Color color, bool flag) { VRTK_BaseHighlighter highligher = (target != null ? target.GetComponentInChildren <VRTK_BaseHighlighter>() : null); //VRTK_BaseHighlighter highligher = target.GetComponentInChildren<VRTK_BaseHighlighter>(); if (highligher != null && highligher.enabled) { if (target.tag == "InteractionObject") { GameManager._Instance.isCanToMicroscope = flag; } if (target.tag == "Microscope") { GameManager._Instance.isMicroscope = flag; } highligher.Initialise(); if (color != Color.clear) { highligher.Highlight(color); } else { highligher.Unhighlight(); } } }
protected virtual void InitialiseHighlighter() { VRTK_BaseHighlighter existingHighlighter = VRTK_BaseHighlighter.GetActiveHighlighter(gameObject); //If no highlighter is found on the GameObject then create the default one if (existingHighlighter == null) { highlightObject.AddComponent <VRTK_MaterialColorSwapHighlighter>(); } else { VRTK_SharedMethods.CloneComponent(existingHighlighter, highlightObject); } //Initialise highlighter and set highlight colour objectHighlighter = highlightObject.GetComponent <VRTK_BaseHighlighter>(); objectHighlighter.unhighlightOnDisable = false; objectHighlighter.Initialise(highlightColor); objectHighlighter.Highlight(highlightColor); //if the object highlighter is using a cloned object then disable the created highlight object's renderers if (objectHighlighter.UsesClonedObject()) { Renderer[] renderers = GetComponentsInChildren <Renderer>(true); for (int i = 0; i < renderers.Length; i++) { if (!VRTK_PlayerObject.IsPlayerObject(renderers[i].gameObject, VRTK_PlayerObject.ObjectTypes.Highlighter)) { renderers[i].enabled = false; } } } }
protected virtual void InternalHighlightObject(GameObject model, Color?highlightColor, float fadeDuration = 0f) { VRTK_BaseHighlighter highlighter = model.GetComponentInChildren <VRTK_BaseHighlighter>(); if (model.activeInHierarchy && highlighter != null) { highlighter.Highlight((highlightColor != null ? highlightColor : Color.white), fadeDuration); } }
/// <summary> /// 显示外框 /// </summary> public void DisplayLine(object sender, DestinationMarkerEventArgs e) { highlighter = e.target.GetComponent <VRTK_BaseHighlighter>(); if (highlighter != null) { highlighter.Initialise(); highlighter.Highlight(Color.yellow); } }
public void OnTriggerEnter(Collider other) { if (other.gameObject.GetComponent <Dupeable>() == null) { return; } ObjectInHighlighter = other.gameObject; Highlighter.Highlight(); }
/// <summary> /// The Highlight method turns on the highlighter with the given Color. /// </summary> /// <param name="highlightColor">The colour to apply to the highlighter.</param> public virtual void Highlight(Color highlightColor) { InitialiseHighlighter(highlightColor); if (baseHighlighter != null && highlightColor != Color.clear) { baseHighlighter.Highlight(highlightColor); } else { Unhighlight(); } }
/// <summary> /// The ToggleHighlight method is used to turn on or off the colour highlight of the object. /// </summary> /// <param name="toggle">The state to determine whether to activate or deactivate the highlight. `true` will enable the highlight and `false` will remove the highlight.</param> public virtual void ToggleHighlight(bool toggle) { InitialiseHighlighter(); if (touchHighlightColor != Color.clear && objectHighlighter) { if (toggle && !IsGrabbed()) { objectHighlighter.Highlight(touchHighlightColor); } else { objectHighlighter.Unhighlight(); } } }
protected virtual void ToggleHighlight(Transform target, Color color) { VRTK_BaseHighlighter highligher = (target != null ? target.GetComponentInChildren <VRTK_BaseHighlighter>() : null); if (highligher != null) { highligher.Initialise(); if (color != Color.clear) { highligher.Highlight(color); } else { highligher.Unhighlight(); } } }
private void ToggleHighlight(Transform target, Color color, bool flag) { VRTK_BaseHighlighter highligher = (target != null ? target.GetComponentInChildren <VRTK_BaseHighlighter>() : null); if (highligher != null) { highligher.Initialise(); if (color != Color.clear) { highligher.Highlight(color, 0.5f); } else { highligher.Unhighlight(); } } }
private void HightLight(Transform target, Color color) { VRTK_BaseHighlighter hightLighter = (target != null ? target.GetComponent <VRTK_BaseHighlighter>() : null); if (hightLighter != null) { hightLighter.Initialise(); if (color != Color.clear) { hightLighter.Highlight(color); } else { hightLighter.Unhighlight(); } } }
/// <summary> /// The ToggleHighlight/2 method is used to turn on or off the colour highlight of the object. /// </summary> /// <param name="toggle">The state to determine whether to activate or deactivate the highlight. `true` will enable the highlight and `false` will remove the highlight.</param> /// <param name="globalHighlightColor">The colour to use when highlighting the object.</param> public virtual void ToggleHighlight(bool toggle, Color globalHighlightColor) { if (highlightOnTouch) { if (toggle && !IsGrabbed() && !IsUsing()) { Color color = (touchHighlightColor != Color.clear ? touchHighlightColor : globalHighlightColor); if (color != Color.clear) { objectHighlighter.Highlight(color); } } else { objectHighlighter.Unhighlight(); } } }
/// <summary> /// apply "color" to "target" to highlight the target /// </summary> /// <param name="target"></param> /// <param name="color"></param> protected virtual void ToggleHighlight(Transform target, Color color) { if (targetLabel != "State" && (targetLabel == "Country" && theTarget.GetComponent <StateInteraction>().interactable == true)) { // only highlight the states on the country map VRTK_BaseHighlighter highligher = (target != null ? target.GetComponentInChildren <VRTK_BaseHighlighter>() : null); if (highligher != null) { highligher.Initialise(); if (color != Color.clear) { highligher.Highlight(color); } else { highligher.Unhighlight(); } } } }
/// <summary> /// The ToggleHighlight/2 method is used to turn on or off the colour highlight of the object. /// </summary> /// <param name="toggle">The state to determine whether to activate or deactivate the highlight. `true` will enable the highlight and `false` will remove the highlight.</param> /// <param name="globalHighlightColor">The colour to use when highlighting the object.</param> public virtual void ToggleHighlight(bool toggle, Color globalHighlightColor) { if (highlightOnTouch && objectHighlighter == null) { InitialiseHighlighter(); } if (objectHighlighter && highlightOnTouch) { if (toggle && !IsGrabbed()) { Color color = (touchHighlightColor != Color.clear ? touchHighlightColor : globalHighlightColor); if (color != Color.clear) { objectHighlighter.Highlight(color); } } else { objectHighlighter.Unhighlight(); } } }