Example #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);
    }
Example #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);
    }
Example #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);
    }
Example #4
0
 public virtual void Awake()
 {
     singilton         = this;
     checkForSelection = true;
     if (GameObject.FindWithTag("debug") != null)
     {
         debugLabel      = GameObject.FindWithTag("debug").GetComponent <Text> ();
         debugLabel.text = "Good to go";
     }
 }
Example #5
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();
    }
Example #6
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);
 }
Example #7
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);
 }
Example #8
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;
 }
Example #9
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);
        }
    }
Example #10
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);
    }
Example #11
0
 void IsRecording(bool isRecording)
 {
     micIsRecording = isRecording;
     GVRInput.DebugMessage("IsRecording: " + isRecording);
 }
Example #12
0
 void IsListening(bool isListening)
 {
     micIsListening = isListening;
     GVRInput.DebugMessage("IsListening: " + isListening);
 }
Example #13
0
 /// <summary>
 /// Deactivates the microphone.
 /// </summary>
 public void DeactivateMicrophone()
 {
     Active = false;
     GVRInput.DebugMessage("DeactivateMicrophone: ");
 }