예제 #1
0
    private CollidedSurface CheckSurroundings()
    {
        CollidedSurface surfaces = CollidedSurface.None;

        if (Xeo.Collisions.IsGrounded(_characterCollider, _collisionMask, env_check_dist))
        {
            surfaces |= CollidedSurface.Ground;
        }

        if (Xeo.Collisions.IsAgainstLeftWall(_characterCollider, _collisionMask, env_check_dist))
        {
            surfaces |= CollidedSurface.LeftWall;
        }

        if (Xeo.Collisions.IsAgainstRightWall(_characterCollider, _collisionMask, env_check_dist))
        {
            surfaces |= CollidedSurface.RightWall;
        }

        return(surfaces);
    }
예제 #2
0
 private bool HasFlag(CollidedSurface cs)
 {
     return (collidingAgainst & cs) != CollidedSurface.None;
 }
예제 #3
0
 public bool HasFlag(CollidedSurface cs)
 {
     return((colliding_against & cs) != CollidedSurface.None);
 }