private void OnClickQ6() { VedioSource.volume = 0.05f; GameObject.Find("Sofa/Scenario/fb").AddComponent <RecordingWav>(); reWav = GameObject.Find("Sofa/Scenario/fb").GetComponent <RecordingWav>(); reWav.StartRecording(); }
// Update is called once per frame void Update() { var headPostion = Camera.main.transform.position; var gazeDirection = Camera.main.transform.forward; RaycastHit hit; if (Physics.Raycast(headPostion, gazeDirection, out hit)) { m_Sprite.enabled = true; this.transform.position = hit.point; this.transform.rotation = Quaternion.FromToRotation(Vector3.forward, hit.normal); if (hit.collider.GetComponent <RecordingWav>()) { old_RecordingWav = hit.collider.GetComponent <RecordingWav>(); old_RecordingWav.UIHighlighted(); } } else { m_Sprite.enabled = false; if (old_RecordingWav) { old_RecordingWav.UINormal(); } } }
// Use this for initialization void Start() { filePath = Path.Combine(Application.persistentDataPath, "Microphone.wav"); recordingWav = GetComponent <RecordingWav>(); if (text_Group_layout == null) { return; } textgroup = text_Group_layout.gameObject.GetComponentsInChildren <Text>(); //UploadAudio(); }
// Use this for initialization void Start() { recongnizer = new GestureRecognizer(); recongnizer.TappedEvent += (source, tapCount, headRay) => { if (FocusedObject != null) { FocusedObject.SendMessageUpwards("OnSelect"); if (FocusedObject.GetComponent <RecordingWav>()) { old_RecordingWav = FocusedObject.GetComponent <RecordingWav>(); old_RecordingWav.UIPressed(); } } }; recongnizer.StartCapturingGestures(); }