void FixedUpdate()
    {
        device = SteamVR_Controller.Input((int)trackedObject.index);

        // Debug
//		Debug.DrawRay(transform.position, transform.up, Color.green);
//		Debug.DrawRay(transform.position, transform.forward, Color.blue);
//		Debug.DrawRay(transform.position, transform.right, Color.red);

        if (controls)
        {
//			Debug.DrawRay (controls.transform.position, controls.transform.up, Color.green);
//			Debug.DrawRay (controls.transform.position, controls.transform.forward, Color.blue);
//			Debug.DrawRay (controls.transform.position, controls.transform.right, Color.red);

            // Update controls
            timecode_text.GetComponent <Text>().text = selectedPlayer.GetTimecode();
            //timecode_group.transform.forward = -GameObject.FindObjectOfType<Camera> ().transform.forward;

            var padding = timeline_group.GetComponent <RectTransform> ().sizeDelta.y / 2;
            var width   = progress_bar_group.GetComponent <RectTransform> ().sizeDelta.x - padding * 2;

            var timecodeRect = timecode_group.GetComponent <RectTransform> ();
            var progressRect = progress_bar.GetComponent <RectTransform> ();

            timecodeRect.anchoredPosition = new Vector2(selectedPlayer.GetProgress() * width, timecodeRect.anchoredPosition.y);
            progressRect.sizeDelta        = new Vector2((1 - selectedPlayer.GetProgress()) * -width, progressRect.sizeDelta.y);

            //Debug.Log ("padding: " + timeline_group.GetComponent<RectTransform> ().sizeDelta + " width: " + width + " progress: " + selectedPlayer.GetProgress()  + " anchoredPosition: " + timecodeRect.anchoredPosition +  " progresswidth: " + ((1 - selectedPlayer.GetProgress()) * width));
            //Debug.Log (rect.);
        }

        DrawLineToVideo();
        SeekVideoByJoystickPosition();
    }
Ejemplo n.º 2
0
 void Update()
 {
     if (vimeoPlayer != null && !dragging)
     {
         GetComponent <Slider>().normalizedValue = vimeoPlayer.GetProgress();
     }
 }