public InputReceivedActionStateCondition(IEnumerable <EInputKey> inInputs,
                                          IInputBinderInterface inInputBinderInterface)
     : base()
 {
     _inputBinderInterface = inInputBinderInterface;
     _boundHandler         = new CustomInputHandler(inInputs, OnInputReceived);
 }
예제 #2
0
        public void ConstructWithMouseInputs_PressingWrongMouseInvokesNothing()
        {
            var handler = new CustomInputHandler(_expectedInputs, OnPressMouse);

            handler.HandleMouseInput(_unexpectedInput, Vector3.back);

            Assert.IsFalse(_callbackInvoked);
        }
예제 #3
0
        public void ConstructWithMouseInputs_PressingMouseInvokesDelegate()
        {
            var handler = new CustomInputHandler(_expectedInputs, OnPressMouse);

            handler.HandleMouseInput(_expectedInputs.First(), Vector3.back);

            ;           Assert.IsTrue(_callbackInvoked);
        }
예제 #4
0
        public void ConstructWithAnalogInputs_PressingWrongAnalogInvokesNothing()
        {
            var handler = new CustomInputHandler(_expectedInputs, OnPressAnalog);

            handler.HandleAnalogInput(_unexpectedInput, 1.0f);

            Assert.IsFalse(_callbackInvoked);
        }
예제 #5
0
        public void ConstructWithAnalogInputs_PressingAnalogInvokesDelegate()
        {
            var handler = new CustomInputHandler(_expectedInputs, OnPressAnalog);

            handler.HandleAnalogInput(_expectedInputs.First(), 1.0f);

            Assert.IsTrue(_callbackInvoked);
        }
예제 #6
0
        public void ConstructWithButtonInputs_PressingWrongButtonInvokesNothing()
        {
            var handler = new CustomInputHandler(_expectedInputs, OnPressButton);

            handler.HandleButtonInput(_unexpectedInput, true);

            Assert.IsFalse(_callbackInvoked);
        }
예제 #7
0
        public void ConstructWithButtonInputs_PressingButtonInvokesDelegate()
        {
            var handler = new CustomInputHandler(_expectedInputs, OnPressButton);

            handler.HandleButtonInput(_expectedInputs.First(), true);

            Assert.IsTrue(_callbackInvoked);
        }