void CreateNode() { if (activeNode != null) { if (selectedObject != null) { Node selectedNode = selectedObject.GetComponent <Node> (); // Return if we are already in edit mode with the node. if (selectedNode != null && selectedNode == activeNode) { return; } // If We are in edit mode but we are trying to create a node, commit the one we have first. else if (selectedNode != null && selectedNode != activeNode) { debugLabel.text = " CreateNode: selectedNode is null or selectedNode is not active Node"; CommitNode(); CmdSpawnNode(endOfLineRef.position, Quaternion.identity); return; } } GVRInput.DebugMessage(" CreateNode: selectedObject is null "); CommitNode(); } CmdSpawnNode(endOfLineRef.position, Quaternion.identity); }
/// <summary> /// unparent the stroke object. /// </summary> public override void OnButtonUp() { GVRInput.DebugMessage("OnButtonUp:"); if (activeMove != null) { GVRInput.DebugMessage("OnButtonUp: activeMove is not null, stopping move"); StopMove(); } else { switch (currentInputMode) { case InputMode.DRAW: EndDrawStroke(); break; case InputMode.MICROPHONE: GVRInput.DebugMessage("OnButtonUp: Stopping mic"); StopMicrophone(); //CommitNode (); break; default: break; } } toolCollection [modeNum].SetMoveTarget(ToolGuideAnchor); toolCollection [modeNum].SetToolAbility(false); }
IEnumerator DelayMic() { GVRInput.DebugMessage("DelayMic: before pause"); yield return(new WaitForSeconds(0.5F)); micWidget.DeactivateMicrophone(); //micWidget.enabled = false; GVRInput.DebugMessage("DelayMic: After the pause"); Invoke("SendTranscriptLate", 2f); }
/// <summary> /// Stops the microphone. /// </summary> void StopMicrophone() { GVRInput.DebugMessage("StopMicrophone:"); TriggerToolAbility(false); if (activeNode == null) { return; //CreateNode (); } toolCollection [modeNum].SetMoveTarget(ToolGuideAnchor); // source.PlayOneShot (micOff); // GVRInput.DebugMessage ("Stopping the Mic"); activeNode.endSpeech(); }
public void beginSpeech() { GVRInput.DebugMessage("beginSpeech:"); GVRInput.DebugMessage("micWidget name = "); GVRInput.DebugMessage(micWidget.name); GVRInput.DebugMessage("preloader name = "); GVRInput.DebugMessage(preloader.name); micWidget.enabled = true; preloader.SetActive(true); micWidget.ActivateMicrophone(); GVRInput.DebugMessage("beginSpeech: Activated Mic."); IsListening(true); IsRecording(true); }
/// <summary> /// Starts the microphone. /// </summary> void StartMicrophone() { GVRInput.DebugMessage("StartMicrophone:"); TriggerToolAbility(true); if (activeNode == null) { return; //CreateNode (); } Debug.LogWarning("Mode Number " + modeNum); Debug.LogWarning(" micAnchor " + micAnchor.name); Debug.LogWarning(" nodename " + activeNode.name); toolCollection [modeNum].SetMoveTarget(micAnchor.transform); activeNode.beginSpeech(); // source.PlayOneShot (micOn); }
void CommitNode() { GVRInput.DebugMessage(" Commiting Node"); if (isDrawing) { EndDrawStroke(); } if (activeNode == null) { GVRInput.DebugMessage("CommitNode: have no active node"); return; } GVRInput.DebugMessage(" Commited Note"); activeNode.SetDesiredPosition(activeNode.resetPosition); activeNode = null; }
void ActivateNode(GameObject incNode) { if (incNode == null) { return; } GVRInput.DebugMessage("ActivateNode:"); Cmd_AuthorityRequest_OnHostFromClient(incNode.GetComponent <NetworkIdentity> ().netId); activeNode = incNode.GetComponent <Node> (); Vector3 halfPoint = controllerPivot.transform.position + (controllerPivot.transform.forward * 11); activeNode.SetDesiredPosition(halfPoint); if (currentInputMode == InputMode.MOVE) { SetMode(lastInputMode); } }
public override void OnSwipe(GVRSwipeDirection dir) { if (dir == GVRSwipeDirection.down) { if (selectedObject != null) { if (activeNode != null) { CommitNode(); } ActivateNode(selectedObject); } else { CreateNode(); } } else if (dir == GVRSwipeDirection.up) { GVRInput.DebugMessage("swipe up"); CommitNode(); } else if (dir == GVRSwipeDirection.right) { if (activeMove != null) { return; } // modeNum++; // UpdateMode (); shouldDraw = !shouldDraw; } else if (dir == GVRSwipeDirection.left) { // modeNum--; // UpdateMode (); } base.OnSwipe(dir); }
void IsRecording(bool isRecording) { micIsRecording = isRecording; GVRInput.DebugMessage("IsRecording: " + isRecording); }
void IsListening(bool isListening) { micIsListening = isListening; GVRInput.DebugMessage("IsListening: " + isListening); }
/// <summary> /// Deactivates the microphone. /// </summary> public void DeactivateMicrophone() { Active = false; GVRInput.DebugMessage("DeactivateMicrophone: "); }