Beispiel #1
0
    private bool IsFront(PieceObject hit)
    {
        if (hit == null)
            return false;
        else if(hit.GetPieceType() != Piece.PieceType.Mirror)
            return true;
        else {
            var flipped = hit.GetComponent<Mirror>().IsFlipped();

            var front = false;
            var facing = this.lazerIn.GetFacing();

            if(facing.y != 0){
                front = facing.y > 0;
            } else {
                front = facing.x > 0;
                front = flipped ? !front : front;
            }
            return front;
        }
    }