Tanoda
RecorderBuddy.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
10using UnityEngine;
11
12public class RecorderBuddy : MonoBehaviour {
13
15
16 public float recordingDuration = 1f;
17 public KeyCode recordButton = KeyCode.Space;
18
19 protected float _curDuration = 0f;
20
21#if UNITY_EDITOR
22 void Reset() {
23 if (recorder == null) {
24 recorder = GetComponent<HierarchyRecorder>();
25 }
26 }
27
28 void Update() {
30 recorder.FinishRecording();
31 }
32
33 if (Input.GetKeyDown(recordButton)) {
34 recorder.BeginRecording();
35 }
36
38 _curDuration += Time.deltaTime;
39 }
40 }
41#endif
42}
KeyCode recordButton
HierarchyRecorder recorder
float _curDuration
float recordingDuration