コード例 #1
0
        public void End_UnregistersGadgetInputHandler()
        {
            var locomotion = new LocomotionActionState(new ActionStateInfo(_inputBinder.gameObject));

            locomotion.Start();

            locomotion.End();

            Assert.IsTrue(_inputBinder.IsHandlerOfTypeUnregistered <GadgetInputHandler>());
        }
コード例 #2
0
        public void Start_SendsLeaveLocomotionStateMessage()
        {
            var locomotion = new LocomotionActionState(new ActionStateInfo(_inputBinder.gameObject));

            var messageSpy = new UnityTestMessageHandleResponseObject <LeaveLocomotionStateMessage>();

            locomotion.Start();

            var handle =
                UnityMessageEventFunctions.RegisterActionWithDispatcher <LeaveLocomotionStateMessage>(
                    _characterComponent.gameObject, messageSpy.OnResponse);

            locomotion.End();

            Assert.IsTrue(messageSpy.ActionCalled);

            UnityMessageEventFunctions.UnregisterActionWithDispatcher(_characterComponent.gameObject, handle);
        }