Exemplo n.º 1
0
    private IEnumerator Transition(int intent, bool changeNode)
    {
        if (transitioning)
        {
            yield break;
        }
        transitioning = true;

        if (changeNode)
        {
            currentNode = currentNode.intentNodeMappings[intent];
        }

        if (currentNode.winState || currentNode.loseState)
        {
            enabled = false;
            yield break;
        }

        yield return(new WaitForSeconds(currentNode.responseDelay));

        if (currentNode.responseList.Count > 0)
        {
            messager.SendNewMessage(currentNode.responseList[Random.Range(0, currentNode.responseList.Count)], false);
        }

        transitioning = false;

        if (currentNode.autoTransition)
        {
            StartCoroutine(Transition(0, true));
        }
    }
 public void SendTextMessage()
 {
     if (inputText.Length == 0)
     {
         return;
     }
     personalMessages.SendNewMessage(inputText, true);
     //TextProcessorScript.CleanText(inputText);
     inputText        = cursorField.text = "";
     cursorPosition   = cursorZoneStart = 0;
     inputField.text  = "Say something...";
     inputField.color = Color.white * .56f;
 }