Exemplo n.º 1
0
    void variableControll(string mouseEvent, string mouseButton)
    {
        if (mouseEvent.Equals("up") && mouseButton.Equals("right"))
        {
            audioSources[1].Play();
            return;
        }
        else if (mouseEvent.Equals("up") && mouseButton.Equals("left"))
        {
            audioSources[1].Play();
            return;
        }
        else if (mouseEvent.Equals("down") && mouseButton.Equals("right"))
        {
            audioSources[0].Play();
            bool flag = sendAction(new Action(Performer.User, ObjectType.Variable, MotionType.Read, name), "");
            if (flag)
            {
                myValue.setValue(getValue());
            }
        }
        else if (mouseEvent.Equals("down") && mouseButton.Equals("left"))
        {
            audioSources[0].Play();

            bool flag = sendAction(new Action(Performer.User, ObjectType.Variable, MotionType.Write, name), "");
            if (flag)
            {
                setValue(myValue.getValue());
            }
        }
    }
Exemplo n.º 2
0
    private void constantControll(string mouseEvent, string mouseButton)
    {
        //audioSources = gameObject.GetComponents<AudioSource>();
        MyValueController myValue = GameObject.FindWithTag("MyValue").GetComponent <MyValueController>();

        if (mouseEvent.Equals("up") && mouseButton.Equals("right"))
        {
            audioSources[1].Play();
        }
        else if (mouseEvent.Equals("up") && mouseButton.Equals("left"))
        {
            return;
        }
        else if (mouseEvent.Equals("down") && mouseButton.Equals("right"))
        {
            audioSources[0].Play();
            bool flag = sendAction(new Action(Performer.User, ObjectType.Constant, MotionType.Read, getValue()), "");
            if (flag)
            {
                myValue.setValue(getValue());
            }
        }
        else if (mouseEvent.Equals("down") && mouseButton.Equals("left"))
        {
            return;
        }
    }