public void HandleVisualEffectsAnnotation(GameObject _head, GameObject _rightPointer, string effectType) { if (!bVisualEffect) { Renderer[] renderers = currentAnimationGO.GetComponentsInChildren <Renderer>(); renderers[0].sharedMaterial = visualEffectsMaterial; renderers[1].sharedMaterial = visualEffectsMaterial; //currentAnimationGO.GetComponent<Renderer>().sharedMaterial.SetTexture("_MainTex", highlightPointsTexture); currentAnimationGO.SetActive(true); currentAnnotation = visualEffectAnnotation = new VisualEffectAnnotation(_video, _rightHand, _rightController, _head, inputManager.PointerColor, effectType); visualEffectAnnotation.IsActive = true; visualEffectAnnotation.setAnnotationDurationTextMesh(_annotationDurationGO.GetComponent <TextMesh>()); visualEffectAnnotation.setID(currentAnnotationID); currentAnnotationID++; bVisualEffect = true; } }
// 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(); }