private void OnTriggerExit(Collider other) { if (other.gameObject == displayInfo.gameObject) { meshRenderer.enabled = true; displayInfo = null; } }
private void OnTriggerEnter(Collider other) { // Try to find a socketable displayInfo = other.GetComponent <StoredSongInfo>(); songsCanvas.text = displayInfo.SongName; globalSongInfo.SongName = displayInfo.songCodeName.ToLower(); // If there isn't one, exit the method if (displayInfo == null) { return; } // find the grabbable OVRGrabbable grabbable = other.GetComponent <OVRGrabbable>(); if (grabbable != null && grabbable.isGrabbed) { // Whatever this grabbable is grabbed by // force it to release this grabbable grabbable.grabbedBy.ForceRelease(grabbable); } displayInfo.GetComponent <Rigidbody>().isKinematic = true; if (doTween) { StartCoroutine(MoveIntoPlace(displayInfo.transform, duration)); } else { displayInfo.transform.position = this.transform.position; displayInfo.transform.rotation = this.transform.rotation; } }