コード例 #1
0
ファイル: CharacterMover.cs プロジェクト: zlotny/Fakemon
 public bool CanPlayerJump(FacingDirection facingDirection)
 {
     RaycastHit2D[] hits = Physics2D.RaycastAll(this.m_collider.bounds.center, FacingDirectionToVector(facingDirection), m_distanceForEachStep * 1.2f);
     foreach (var hit in hits)
     {
         Ledge ledgeComponent = hit.collider.GetComponent <Ledge>();
         if (ledgeComponent == null)
         {
             continue;
         }
         if (ledgeComponent.GetJumpableDirection() == this.m_facingDirection)
         {
             return(true);
         }
     }
     return(false);
 }