public void ForceAxisValueTest()
    {
        var axis  = "Horizontal";
        var value = 1.0f;

        InputHelper.ForceAxis(axis, value);

        Assert.That(InputHelper.GetAxis(axis), Is.EqualTo(value).Within(.0001f));
    }
    public void ForcingValueForGivenAxisOnlyTest()
    {
        var axis  = "Horizontal";
        var value = 1.0f;

        InputHelper.ForceAxis(axis, value);

        Assert.That(InputHelper.GetAxis("Vertical"), Is.EqualTo(0.0f).Within(.0001f));
    }
Beispiel #3
0
    void Start()
    {
        if (!string.IsNullOrEmpty(buttonToForce))
        {
            InputHelper.ForceButton(buttonToForce);
        }

        if (!float.IsNaN(axisValueToForce))
        {
            InputHelper.ForceAxis(buttonToForce, axisValueToForce);
        }
    }
    public void ResetingForcedKeysAndValuesTest()
    {
        var fireButton = "Fire1";
        var axis       = "Horizontal";
        var value      = 1.0f;

        InputHelper.ForceButton(fireButton);
        InputHelper.ForceAxis(axis, value);

        InputHelper.ResetForced();

        Assert.That(InputHelper.GetButton(fireButton), Is.False);
        Assert.That(InputHelper.GetAxis(axis), Is.EqualTo(0.0f).Within(.0001f));
    }