void SelectDataset(GameObject hit) { if (buttonSelected != null) { Image buttonImg = buttonSelected.GetComponent <Image>(); buttonImg.sprite = spriteButton; } if (_video != null) { _video.Close(); SaveAnnotations(); } _video = new CloudVideoPlayer(hit.name, this); buttonSelected = hit.transform.gameObject.GetComponent <Button>(); Image img = buttonSelected.GetComponent <Image>(); img.sprite = spriteButtonSelected; LoadAnnotations(); _annotationManager.SetCloudVideo(_video); }
void SelectDataset() { Ray raycast = new Ray(_leftHand.transform.position, _leftHand.transform.forward); RaycastHit hit; bool bHit = Physics.Raycast(raycast, out hit); if (hit.transform != null) { Button b = hit.transform.gameObject.GetComponent <Button>(); if (b != null) { b.Select(); if (_leftController.GetPress(SteamVR_Controller.ButtonMask.Trigger)) { if (b.name == "PlaySpeed") { SetPlaybackSpeed(float.Parse(b.GetComponent <VRUIItem>().value)); return; } if (b.name == "Representation") { SetRepresentation(b.GetComponent <VRUIItem>().value); return; } if (_video != null && _video.configFile == b.name) { return; } else if (_video != null && _video.configFile != b.name) { _video.Close(); } _video = new CloudVideoPlayer(b.name, this); if (!annotationManagerByVideo.ContainsKey(_video)) { _annotationManager = new AnnotationManager(); _annotationManager.init(); _annotationManager.SetCloudVideo(_video); annotationManagerByVideo.Add(_video, _annotationManager); } CloseAllMenus(); DisableLeftPointer(); _menu = MenuOpened.None; } } } }