Ejemplo n.º 1
0
        private void TriggerMiddleEnterLadder()
        {
            _triggerEnterOnce = false;
            _isUsingLadder    = true;
            _thirdPersonAnimator.applyRootMotion = true;
            _ladderKind = LadderKind.Null;

            _player.stateInterface.State.MiddleEnterLadder();
        }
Ejemplo n.º 2
0
 private void TriggerExitLadder()
 {
     _triggerExitOnce = true;
     _player.stateInterface.State.ExitLadder((float)_toLadderLocation, () =>
     {
         _triggerExitOnce = false;
         _isUsingLadder   = false;
         _thirdPersonAnimator.applyRootMotion = false;
         _ladderKind = LadderKind.Null;
     });
 }
Ejemplo n.º 3
0
 private void Reset()
 {
     _isUsingLadder    = false;
     _triggerEnterOnce = false;
     _triggerExitOnce  = false;
     if (null != _thirdPersonAnimator)
     {
         _thirdPersonAnimator.applyRootMotion = false;
     }
     _toLadderLocation = LadderLocation.Null;
     _ladderKind       = LadderKind.Null;
 }
Ejemplo n.º 4
0
        private void TestExitLadderImpl(LadderLocation ladderLocation)
        {
            _toLadderLocation = ladderLocation;
            if (!_isUsingLadder || _triggerEnterOnce || _triggerExitOnce)
            {
                return;
            }

            if (LadderLocation.Bottom == ladderLocation && _ladderSpeed < -0.05f ||
                (LadderLocation.Top == ladderLocation && _ladderSpeed > 0.05f))
            {
                _ladderKind = LadderKind.Exit;
                TriggerExitLadder();
            }
        }
Ejemplo n.º 5
0
        private void TestEnterLadderImpl(LadderLocation location)
        {
            _toLadderLocation = location;
            if (_isUsingLadder || _triggerEnterOnce || _triggerExitOnce)
            {
                return;
            }

            if (_ladderSpeed > 0.05f)
            {
                if (LadderLocation.Bottom == location ||
                    LadderLocation.Top == location)
                {
                    _ladderKind = LadderKind.Enter;
                    TriggerEnterLadder();
                }
                else if (LadderLocation.Middle == location)
                {
                    TriggerMiddleEnterLadder();
                }
            }
        }