Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (secondFrame)
        {
            secondFrame = false;
            rtsMinor    = gameObject.transform.parent;
            rtsInstanceMinor.enabled = false;

            RetrieveColumnNames();
        }
        if (virgin)
        {
            InvokeRepeating("CountDown", 0.1f, 0.1f);
            virgin            = false;
            areaOfEffect.size = new Vector3(1.5f, tableHeight * 2, 1.5f);

            rtsInstanceMinor         = gameObject.AddComponent <Leap.Unity.JamesV_LeapRTS>();
            rtsInstanceMinor.enabled = true;;

            secondFrame = true;
        }

        if (timer == 0)
        {
            for (int i = 0; i < columns.Count; i++)
            {
                columns[i].GetComponent <Column>().columnTriggered(false);
            }
            triggered = false;
            selectTool.removeTable(gameObject);
            t.UpdateInfo(outPut, false);
        }
    }
Example #2
0
    // Update is called once per frame
    void Update () {
	    if(virgin)
        {
            InvokeRepeating("CountDown", 0.1f, 0.1f);
            virgin = false;
            objMesh.color = instanceColor;
        }

        if(runnable)
        {
            runnable = false;
            changeable = false;
            StartCoroutine(triggerTransition(triggered));
        }

        if(timer == 0)
        {
            t.UpdateInfo(ID, false);
            touched = false;
        }
	}
Example #3
0
    private void OnPhraseRecognized(PhraseRecognizedEventArgs args)
    {
        StringBuilder builder = new StringBuilder();

        builder.AppendFormat("{0} ({1}){2}", args.text, args.confidence, Environment.NewLine);
        builder.AppendFormat("\tTimestamp: {0}{1}", args.phraseStartTime, Environment.NewLine);
        builder.AppendFormat("\tDuration: {0} seconds{1}", args.phraseDuration.TotalSeconds, Environment.NewLine);
        wordChain.Add(args.text);
        Debug.Log(builder.ToString());
        if (args.text.Equals("exit", StringComparison.OrdinalIgnoreCase))
        {
            isTyping    = false;
            isScrolling = false;
            Debug.Log("Flushing chain");
            wordChain = new List <string>(); // Flush the chain
        }
        else if (isScrolling)
        {
            if (args.text.Equals("up", StringComparison.OrdinalIgnoreCase))
            {
                if (dataPointer - (2 * dataInc) <= 0)
                {
                    dataPointer = 0;
                }
                else
                {
                    dataPointer -= (2 * dataInc);
                }
                Debug.Log(dataPointer);

                string message = "";
                int    counter = 0;
                for (int i = dataPointer; counter < dataInc && i < dataList.Count; i++)
                {
                    if (TranslateLetters(dataList[i]) != dataList[i])
                    {
                        message += dataList[i] + " --> " + TranslateLetters(dataList[i]) + "\n";
                    }
                    else
                    {
                        message += dataList[i] + "\n";
                    }
                    dataPointer++;
                    counter++;
                }
                WindowTextController.UpdateInfo(message, true);
            }
            else if (args.text.Equals("down", StringComparison.OrdinalIgnoreCase))
            {
                Debug.Log(dataPointer);
                string message = "";
                int    counter = 0;
                for (int i = dataPointer; counter < dataInc && i < dataList.Count; i++)
                {
                    if (TranslateLetters(dataList[i]) != dataList[i])
                    {
                        message += dataList[i] + " --> " + TranslateLetters(dataList[i]) + "\n";
                    }
                    else
                    {
                        message += dataList[i] + "\n";
                    }
                    if (dataPointer < dataList.Count - 1)
                    {
                        dataPointer++;
                    }
                    counter++;
                }
                WindowTextController.UpdateInfo(message, true);
            }
        }
        else if (isTyping)
        {
            if (args.text.Equals("capitalize", StringComparison.OrdinalIgnoreCase))
            {
                isCapitalized = true;
            }
            else if (args.text.Equals("delete", StringComparison.OrdinalIgnoreCase) && textField.text.Length > 0)
            {
                textField.text = textField.text.Substring(0, textField.text.Length - 1);
                KeyboardController.backSpace();
            }
            else if (args.text.Equals("back", StringComparison.OrdinalIgnoreCase) && textField.text.Length > 0)
            {
                textField.text = textField.text.Substring(0, textField.text.Length - 1);
                KeyboardController.backSpace();
            }
            else if (args.text.Equals("erase", StringComparison.OrdinalIgnoreCase))
            {
                textField.text = "";
                KeyboardController.clearText();
            }
            else if (args.text.Equals("grab", StringComparison.OrdinalIgnoreCase))
            {
                if (DataCache.ReadCacheMessage().IndexOf("-") > -1)
                {
                    textField.text += DatabaseUtilities.VedicDatabase.GetColumnName(DataCache.ReadCacheMessage());
                    KeyboardController.buildString(DatabaseUtilities.VedicDatabase.GetColumnName(DataCache.ReadCacheMessage()));
                }
                else
                {
                    textField.text += DatabaseUtilities.VedicDatabase.GetTableName(DataCache.ReadCacheMessage());
                    KeyboardController.buildString(DatabaseUtilities.VedicDatabase.GetTableName(DataCache.ReadCacheMessage()));
                }
            }
            else
            {
                textField.text += TranslateLetters(args.text);
                KeyboardController.buildString(TranslateLetters(args.text));
            }
        }
        else if (args.text.Equals("execute", StringComparison.OrdinalIgnoreCase))
        {
            ActivateWordChain();
        }
        else if (args.text.Equals("flush", StringComparison.OrdinalIgnoreCase))
        {
            Debug.Log("Flushing chain");
            wordChain = new List <string>(); // Flush the chain
        }
        else if (args.text.Equals("teletype", StringComparison.OrdinalIgnoreCase))
        {
            isTyping = true;
            Debug.Log("Flushing chain");
            wordChain = new List <string>(); // Flush the chain
        }
        else if (args.text.Equals("scroll", StringComparison.OrdinalIgnoreCase))
        {
            isScrolling = true;
            Debug.Log("Flushing chain");
            wordChain = new List <string>(); // Flush the chain
        }
    }