Exemple #1
0
        public bool canMove(float inputX)
        {
            bool canMove = true;

            Vector2 direction = inputX > 0 ? Vector2.right : Vector2.left;



            for (int i = 0; i < colliders.Length && canMove; i++)
            {
                Collider2D aCollider = colliders[i];
                if (aCollider.isActiveAndEnabled)
                {
                    canMove = MovementHelper.canMove(aCollider, inputX > 0 ? Vector2.right : Vector2.left, collisionLayers);
                    if (canMove == false)
                    {
                        break;
                    }
                }
            }
            return(canMove);
        }
Exemple #2
0
 public bool isMoveable(Vector2 direction)
 {
     return((isSlippery || isOnSlipperyGround()) && MovementHelper.canMove(collider, direction, collisionLayers));
 }