My best friend (more like only friend) I've been hanging out with every single weekend (I'm a female he's a male; I have a boyfriend he has a wife and kids so I felt comfortable) for a whole year just hit me with a shocker. He suddenly told me that he made up pretty much everything about his life a few hours ago. He said he has two realities one where it's reality and he has to deal with problems and two where he's a husband and father and lives in this fantasy world. I'm stunned. He talks about his wife and his kids to me, tells stories, relates the conversation back to them. It seems impossible to pull of what he did and keep this lie going strong for a year. 

I'm really a naturally trusting person and I completely believed him and this kind of rocked my whole world. I've invested a lot into the friendship and enjoy spending time with him but I have no idea how to interpret this curve ball. Could this be some mental illness? I have BPD and bipolar myself but I don't know what it could be. Any insight is appreciated. I don't want to talk to friends or family about it because I'm ashamed I believed him for this long and I think everyone will say to abandon the friendship.