Exemplo n.º 1
0
    void Update()
    {
        if (blueC.CheckActive())
        {
            // Change Camera
            currChange = blueC.butTop;
            // Ensures that the function is only called once, even if the button is held down
            if (currChange && (currChange != prevChange))
            {
                changeCamera();
            }
            prevChange = currChange;

            // Pan Camera
            pan = Map(blueC.joyTopRightX, 0, joystickMax, -joystickNewRange, joystickNewRange);
            PanCamera(pan);

            // Pitch Camera
            pitch = Map(blueC.joyTopRightY, 0, joystickMax, -joystickNewRange, joystickNewRange);
            PitchCamera(-pitch);

            // Change Camera Zoom
            zoom = Map(blueC.joyTopLeftY, 0, joystickMax, -joystickNewRange, joystickNewRange);
            ajustZoomLevel(zoom);
        }
    }
Exemplo n.º 2
0
    void Update()
    {
        if (blueC.CheckActive())
        {
            Buttons();

            pan   = Map(blueC.joyLeftX, 0, joystickMax, -joystickNewRange, joystickNewRange);
            pitch = Map(blueC.joyLeftY, 0, joystickMax, -joystickNewRange, joystickNewRange);

            RotateCannon(pan, pitch);
        }
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (running)
        {
            rotationValue = (int)(70 * Mathf.Sin(x[index] / speedFactor));

            needleRect.rotation = Quaternion.Euler(0, 0, rotationValue);

            index++;
            index %= x.Length;

            if (bluetoothConnection.CheckActive() || active)
            {
                if (bluetoothConnection.butMid || Input.GetKeyDown(KeyCode.Space) || Input.GetButtonDown("LeftTrigger"))
                {
                    Fire(GetSegment());
                    StartCoroutine(Pause());
                }
            }
        }
    }