Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    /// <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);
    }
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
    /// <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();
    }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
 /// <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);
 }
Ejemplo n.º 7
0
 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;
 }
Ejemplo n.º 8
0
    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);
        }
    }
Ejemplo n.º 9
0
    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);
    }
Ejemplo n.º 10
0
 void IsRecording(bool isRecording)
 {
     micIsRecording = isRecording;
     GVRInput.DebugMessage("IsRecording: " + isRecording);
 }
Ejemplo n.º 11
0
 void IsListening(bool isListening)
 {
     micIsListening = isListening;
     GVRInput.DebugMessage("IsListening: " + isListening);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Deactivates the microphone.
 /// </summary>
 public void DeactivateMicrophone()
 {
     Active = false;
     GVRInput.DebugMessage("DeactivateMicrophone: ");
 }