Пример #1
0
 /// <summary>
 /// Detaches the Character from the ledge, losing any reference to it, and restoring permissions
 /// </summary>
 protected virtual void DetachFromLedge()
 {
     _ledge             = null;
     _character.CanFlip = true;
     _characterHorizontalMovement.AbilityPermitted = true;
     _controller.CollisionsOn();
 }
Пример #2
0
 /// <summary>
 /// Detaches the Character from the ledge, losing any reference to it, and restoring permissions
 /// </summary>
 protected virtual void DetachFromLedge()
 {
     _ledge             = null;
     _character.CanFlip = true;
     _characterHorizontalMovement.AbilityPermitted = true;
     _controller.CollisionsOn();
     if (_startFeedbackIsPlaying)
     {
         StopStartFeedbacks();
         PlayAbilityStopFeedbacks();
     }
 }
Пример #3
0
        /// <summary>
        /// Grabs the ledge if possible
        /// </summary>
        /// <param name="ledge"></param>
        public virtual void StartGrabbingLedge(Ledge ledge)
        {
            // we make sure we're facing the right direction
            if ((_character.IsFacingRight && (ledge.LedgeGrabDirection == Ledge.LedgeGrabDirections.Left)) ||
                (!_character.IsFacingRight && (ledge.LedgeGrabDirection == Ledge.LedgeGrabDirections.Right)))
            {
                return;
            }

            // we make sure we can grab the ledge
            if (!AbilityPermitted ||
                (_movement.CurrentState == CharacterStates.MovementStates.Jetpacking))
            {
                return;
            }

            // we start hanging from the ledge
            _ledgeHangingStartedTimestamp = Time.time;
            _ledge = ledge;
            _controller.CollisionsOff();
            _movement.ChangeState(CharacterStates.MovementStates.LedgeHanging);
        }
Пример #4
0
 public static void Trigger(Collider2D characterCollider, Ledge ledgeGrabbed)
 {
     e.CharacterCollider = characterCollider;
     e.LedgeGrabbed      = ledgeGrabbed;
     MMEventManager.TriggerEvent(e);
 }
Пример #5
0
 public LedgeEvent(Collider2D characterCollider, Ledge ledgeGrabbed)
 {
     CharacterCollider = characterCollider;
     LedgeGrabbed      = ledgeGrabbed;
 }