Ejemplo n.º 1
0
    private void JoystickInput()
    {
        if (IsActionKeyPressed(EActionKey.Click))
        {
            if (!joystickPressed)
            {
                ActionKey hitBtnObject = pointer.LastEnteredGO.GetComponent <ActionKey>();

                if (hitBtnObject != null)
                {
                    //Debug.Log(hitBtnObject.name);
                    btnForward.SetNotPressed();
                    btnRight.SetNotPressed();
                    btnBack.SetNotPressed();
                    btnLeft.SetNotPressed();

                    hitBtnObject.SetPressed();
                    joystickPressed = true;
                }
            }
        }
        else
        {
            joystickPressed = false;

            btnForward.SetNotPressed();
            btnRight.SetNotPressed();
            btnBack.SetNotPressed();
            btnLeft.SetNotPressed();

            //Debug.Log("up");
        }

        if (IsActionKeyPressed(EActionKey.Interact))
        {
            const int light_intensity = 20;
            const int light_angle     = 100;
            const int boost_duration  = 1;
            flashLight.SetLight(light_intensity, light_angle, boost_duration);
        }
    }