Esempio n. 1
0
    internal VectorKeyboardInputResponder(TextMesh x, TextMesh y, TextMesh z, TextMesh tmin, TextMesh tmax)
    {
        es       = new ExpressionSet();
        xText    = x;
        yText    = y;
        zText    = z;
        tminText = tmin;
        tmaxText = tmax;
        dens     = CustomVectorField.SampleDensity.LOW;

        currExpression = es.expressions["X"];
        currText       = xText;
    }
Esempio n. 2
0
    public void Flex_ActionStart(string name, FlexActionableComponent sender, GameObject collider)
    {
        switch (sender.name)
        {
        case "Button_del":
            if (index > 0)
            {
                currExpression.tokens.RemoveAt(index - 1);
                index--;
            }
            break;

        case "Button_Clear":
            index = 0;
            currExpression.tokens.Clear();
            break;

        case "Button_Enter":
            isReady = true;
            break;

        default:
            currExpression.tokens.Insert(index, sender.name);
            isReady = true;
            index++;
            break;

        case "Button_left":
            index--;
            if (index < 0)
            {
                index = 0;
            }
            break;

        case "Button_right":
            index++;
            if (index > currExpression.tokens.Count)
            {
                index = currExpression.tokens.Count;
            }
            break;

        case "Button_start":
            index = 0;
            break;

        case "Button_end":
            index = currExpression.tokens.Count;
            break;

        case "Button_Xinput":
            currExpression = es.expressions["X"];
            currText       = xText;
            index          = currExpression.tokens.Count;
            break;

        case "Button_Yinput":
            currExpression = es.expressions["Y"];
            currText       = yText;
            index          = currExpression.tokens.Count;
            break;

        case "Button_Zinput":
            currExpression = es.expressions["Z"];
            currText       = zText;
            index          = currExpression.tokens.Count;
            break;

        case "tmin":
            currExpression = es.ranges["t"].Min;
            currText       = tminText;
            index          = currExpression.tokens.Count;
            break;

        case "tmax":
            currExpression = es.ranges["t"].Max;
            currText       = tmaxText;
            index          = currExpression.tokens.Count;
            break;

        case "high":
            dens    = CustomVectorField.SampleDensity.HIGH;
            isReady = true;
            break;

        case "medium":
            dens    = CustomVectorField.SampleDensity.MEDIUM;
            isReady = true;
            break;

        case "low":
            dens    = CustomVectorField.SampleDensity.LOW;
            isReady = true;
            break;
        }
        //index++;
        xText.text    = displayText(es.expressions["X"].tokens, es.expressions["X"].tokens.Count, false);
        yText.text    = displayText(es.expressions["Y"].tokens, es.expressions["Y"].tokens.Count, false);
        zText.text    = displayText(es.expressions["Z"].tokens, es.expressions["Z"].tokens.Count, false);
        tminText.text = displayText(es.ranges["t"].Min.tokens, es.ranges["t"].Min.tokens.Count, false);
        tmaxText.text = displayText(es.ranges["t"].Max.tokens, es.ranges["t"].Max.tokens.Count, false);
        currText.text = displayText(currExpression.tokens, index, true);

        sender.SetState(1);
    }