Example #1
0
    public void Tick()
    {
        if (!_asyncTaskProcessor.IsProcessing(_climbingRoutine))
        {
            MovePlayer();

            if (_playerState != PlayerState.Jumping)
            {
                CheckForFloor();
            }
            if (_playerState == PlayerState.Ground)
            {
                //JumpCheck();
            }

            Vector3?climbTarget = CheckForClimbableSurfaces();
            if (climbTarget != null)
            {
                _climbingRoutine = ClimbSurface(climbTarget.Value);
                _asyncTaskProcessor.Process(_climbingRoutine, () => { _climbingRoutine = null; });
            }


            // TODO: Maybe let this go if our guy is too heavy

            /*if (!_asyncTaskProcessor.IsProcessing(_applyGravityRoutine))
             * {
             *  _applyGravityRoutine = ApplyGravity();
             *  _asyncTaskProcessor.Process(_applyGravityRoutine, () =>
             *  {
             *      _applyGravityRoutine = null;
             *  });
             * }*/
        }
    }
Example #2
0
 public void StartDash()
 {
     _dashRoutine = _timerCoroutineFactory.CreateTimer(.5f);
     _asyncTaskProcessor.Process(_dashRoutine, () =>
     {
         _dashRoutine = null;
     });
 }