示例#1
0
    public void ProcessState()
    {
        inputField.interactable         = false;
        stepButtonLight.color           = Color.gray;
        processButton.interactable      = false;
        startMachineButton.interactable = false;

        int    actualState = tm.InitialStateIndex();
        string input       = null;

        try
        {
            input = "" + int.Parse(stateDisplay.text);
        }
        catch {}

        if (input != null)
        {
            actualState = int.Parse(input);
        }

        ArrayList result = tm.ProcessCell(tm.StateByIndex(actualState), actualState);

        if ((bool)result[0])
        {
            StartCoroutine(WaitMachine(speed / 2));
            return;
        }
        else
        {
            if (currentStopCoroutine != null)
            {
                StopCoroutine(currentStopCoroutine);
            }

            currentStopCoroutine = tm.StopMachine(tm.StateByIndex((int)result[1]));

            StartCoroutine(currentStopCoroutine);
        }
    }