public override void Grabbed(VRTK_InteractGrab currentGrabbingObject) { base.Grabbed(currentGrabbingObject); slideCollider.enabled = true; if (ammoTooltipGameObject != null) { ammoTooltipGameObject.SetActive(true); } if (ammoTooltip != null) { ammoTooltip.UpdateText(bulletsLeftInClip + " / " + bulletClipSize); } controllerEvents = currentGrabbingObject.GetComponent <VRTK_ControllerEvents>(); ToggleSlide(true); slide.reloadAction += Reloaded; if (VRTK_DeviceFinder.GetControllerHand(currentGrabbingObject.controllerEvents.gameObject) == SDK_BaseController.ControllerHand.Left) { allowedTouchControllers = AllowedController.LeftOnly; allowedUseControllers = AllowedController.LeftOnly; slide.allowedGrabControllers = AllowedController.RightOnly; } else if (VRTK_DeviceFinder.GetControllerHand(currentGrabbingObject.controllerEvents.gameObject) == SDK_BaseController.ControllerHand.Right) { allowedTouchControllers = AllowedController.RightOnly; allowedUseControllers = AllowedController.RightOnly; slide.allowedGrabControllers = AllowedController.LeftOnly; } }
void textUpdater(int moleculeIndex) { switch (moleculeIndex) { case 0: tooltip_1.UpdateText("Ethanol"); tooltip_2.UpdateText("Ethanol"); break; case 1: tooltip_1.UpdateText("Water"); tooltip_2.UpdateText("Water"); break; } }
public void OnTriggerEnter(Collider other) { Tooltip.containerColor.a = 255; Tooltip.UpdateText(textAffichage); //on affiche les informations Parent = transform.root.gameObject; //on recupère le gameobject parent dans la hierarchie allChildren = Parent.GetComponentsInChildren <Renderer>(); //Récupération des objets du modele if (tag == "Highlight") { tag = "Origin"; //tag l'objet d'origin for (int i = 0; i < allChildren.Length; i++) //On parcours tout les objects du modèle { if (allChildren[i].tag != "Origin") //Si ce n'est pas l'origine on le rend transparent { allChildren[i].material = TransparentMaterial; } if (allChildren[i].tag == "Origin")//Si c'est l'origine on lui rend son material de base. { allChildren[i].material = this.OriginMaterial; } } tag = "Highlight";//on remet le bon tag } }
public void ShowTooltip(string text, float duration) { m_duration = duration > 0 ? duration : float.PositiveInfinity; m_objectTooltip.gameObject.SetActive(true); m_objectTooltip.UpdateText(text); m_tooltipActivatedTime = Time.time; }
public void CorrectAnswer() { //flash dark green and black Tick // switch to Colour green toolTipOfObject.containerColor = Color.green; //Change name toolTipOfObject.UpdateText(PreferedName); // play ding // //add score // add from score GameController.SavedTime += TimeAddedForCorrectAnswer; // remove object from the controller GameController.Unanwsered.Remove(this.gameObject); // disable //transformVRTK_InteractableObject SphereVRTKController.disableWhenIdle = false; SphereVRTKController.enabled = false; }
protected virtual void Awake() { tooltipScript = GetComponent <VRTK_ObjectTooltip>(); tooltipScript.displayText = transform.parent.name; tooltipScript.UpdateText(transform.parent.name); }