public void It_should_not_trigger_if_there_isnt_a_matching_tag_on_the_collider()
            {
                _collider.CompareTag("Player").Returns(false);
                GetEventTrigger(_monitor).Invoke(_collider);
                _actionTrigger.Update();

                Assert.IsFalse(_result);
            }
Beispiel #2
0
        protected void UpdateTrigger(ICollider collider)
        {
            if (string.IsNullOrEmpty(_tag))
            {
                _triggerUpdate = true;
                return;
            }

            _triggerUpdate = collider.CompareTag(_tag);
        }
            public void BeforeEach()
            {
                _result = false;

                _monitor = Substitute.For <ITriggerMonitor>();
                GetEventTrigger(_monitor).Returns(new EventTrigger());

                _actionTrigger         = GetNewActionTrigger("Player", (action) => _result = true);
                _actionTrigger.Monitor = _monitor;
                _actionTrigger.Enter();

                _collider = Substitute.For <ICollider>();
                _collider.CompareTag("Player").Returns(true);
            }