private void Start() { animator = GetComponent <Animator>(); controlBoard_RecordControl = GetComponent <ControlBoardControl>(); ResetRecorder(); controlBoard_RecordControl.GiveAwayControlBoardFocus(); }
public void StopRecording() { m_recording = false; if (m_recorder.isRecording) { SteamVR_Controller.Input(Input.GetButtonDown("Button1") ? 1 : 2).TriggerHapticPulse(1000); m_recorder.SaveToClip(m_clip); m_recorder.ResetRecording(); ResetRecorder(); if (!previewAnimator.isInitialized) { previewAnimator.Rebind(); } if (previewAnimator.gameObject.activeSelf && previewAnimator.isActiveAndEnabled) { previewAnimator.SetTrigger("PlayPreview"); } controlBoard_RecordControl.GiveAwayControlBoardFocus(); foreach (GameObject indicator in indicators) { indicator.SetActive(false); } } }
private void Update() { if (playing) { animationMapping.Value += playbackRate.Value * Time.deltaTime / animationTime; if (animationMapping.Value > 1) { if (loop) { animationMapping.Value = 0; } else { playing = false; onStop.Invoke(); control.GiveAwayControlBoardFocus(); animationMapping.Value = 0; } } } }