public ScribblerAnnotation AddScribblerAnnotation(GameObject lineRendererGO, float timeOfCreation, Vector3 center) { ScribblerAnnotation sbAnnotation = new ScribblerAnnotation(); sbAnnotation.ID = ScribblerAnnotationList.Count + 1; sbAnnotation.LineRendererGO = lineRendererGO; sbAnnotation.TimeOfCreation = timeOfCreation; sbAnnotation.center = center; ScribblerAnnotationList.Add(sbAnnotation); return(sbAnnotation); }
public void HandleScribblerAnnotation() { if (!bScribbler) { Renderer[] renderers = currentAnimationGO.GetComponentsInChildren <Renderer>(); renderers[0].sharedMaterial = scribblerMaterial; renderers[1].sharedMaterial = scribblerMaterial; //currentAnimationGO.GetComponent<Renderer>().sharedMaterial.SetTexture("_MainTex", scribblerTexture); currentAnimationGO.SetActive(true); currentAnnotation = scribblerAnnotation = new ScribblerAnnotation(_video, _rightHand, _rightController, inputManager.PointerColor, _head); scribblerAnnotation.IsActive = true; scribblerAnnotation.setAnnotationDurationTextMesh(_annotationDurationGO.GetComponent <TextMesh>()); scribblerAnnotation.setID(currentAnnotationID); currentAnnotationID++; bScribbler = true; } }
public void DeleteScribblerAnnotation(ScribblerAnnotation sbAnnotation) { if (sbAnnotation == null) { Debug.Log("ERROR: ScribblerAnnotation object is null"); return; } foreach (ScribblerAnnotation annotation in ScribblerAnnotationList) { if (annotation.ID == sbAnnotation.ID) { ScribblerAnnotationList.Remove(annotation); Debug.Log("ScribblerAnnotation - " + sbAnnotation.ID + " was delete from list"); } else { Debug.Log("ERROR: Unable to delete ScribblerAnnotation - " + sbAnnotation.ID); } } Debug.Log("ERROR: Unable to find the ScribblerAnnotation - " + sbAnnotation.ID); }
// Use this for initialization public void init() { IsAnnotationActive = false; currentAnimationGO = GameObject.Instantiate(Resources.Load("Prefabs/CurrentAnnotation")) as GameObject; currentAnimationGO.SetActive(false); bVisualEffect = false; bScribbler = false; bSpeechToText = false; bMark = false; IsPlayingVideo = false; //Load menu buttons materials speechMaterial = Resources.Load("Materials/speechToTextMat") as Material; scribblerMaterial = Resources.Load("Materials/scribblerMat") as Material; visualEffectsMaterial = Resources.Load("Materials/highlightPointsMat") as Material; markMaterial = Resources.Load("Materials/markMat") as Material; deleteTexture = Resources.Load("Textures/deleteActive") as Texture; scribblerAnnotation = null; visualEffectAnnotation = null; markAnnotation = null; speechAnnotation = null; staticAnnotationList = new List <StaticAnnotation>(); currentTime = 0.0f; currentAnnotationID = 0; currentAnnotation = null; inputManager = GameObject.Find("Controller (right)").GetComponentInChildren <InputManager>(); currentAnnotationSelected = -1; DrawAnnotationsOnTimeline(); }
private void LeftMouseReleaseEvent() { //pause a frame so you don't pick up the same mouse down event. //yield return new WaitForEndOfFrame(); lmbclicked = false; Debug.Log("LMB RELEASE"); if (scribblerButtonIsActive && deltaHoldTime > doubleClickTimeLimit) { scribbler.IsActive = false; scribbler.assignClosestBone(trackerClientRecorded.Humans); ScribblerAnnotation sbAnnotation = annotationManager.AddScribblerAnnotation(scribbler.lineRendererGO, Time.time, scribbler.center); sbAnnotation.TimeOfCreation = currentExecutionTime; } if (highlightPointsButtonIsActive && deltaHoldTime > doubleClickTimeLimit) { highlightPoints.IsActive = false; HighlightPointsAnnotation hpAnnotation = annotationManager.AddHighlightPointsAnnotation(highlightPoints.bonesTransforms, Time.time); hpAnnotation.highlightColor = color; hpAnnotation.TimeOfCreation = currentExecutionTime; } deltaHoldTime = 0; }