Beispiel #1
0
        public void TestQueueEvent()
        {
            var actionBuffers = new ActionBuffers(new ActionSegment <float>(new[] { 1f }), ActionSegment <int> .Empty);
            var context       = new InputActuatorEventContext(1, m_Device);

            using (context.GetEventForFrame(out var eventPtr))
            {
                m_Adaptor.WriteToInputEventForAction(eventPtr, m_Action, m_Control, new ActionSpec(), actionBuffers);
            }
            InputSystem.Update();
            var val = m_Action.ReadValue <float>();

            Assert.IsTrue(Mathf.Approximately(1f, val));
        }