It is not uncommon to dream of past loves. Especially when the memories of that person are pleasant or remind us of a more simple time in our lives. High school is a time that many people remember strongly because its a time when we experienced so many new things at a time when we were just old enough to understand and deal with it without the responsibility of being an adult.
As adults, especially when our lives and/or relationships are not what we think or wish they can be, we start to think back to a time when everything seemed happy or simpler and we remember the feeling of first being in love, or the first person who made us feel special or loved. We compare that years ago love with the love we have now and sometimes it seems better.
The important thing to remember is that the same person you are dreaming about is an adult just like you, they've gotten older like you, and they can be experiencing some of the same problems and issues that you and your friends and associates are experiencing as well. Remember that you're not just dreaming about your ex, but you're dreaming about a time that you may remember as being innocent, fun, exciting, all things that you may feel are missing from your life right now.
The best thing is to do something different with your life. Take a class, teach a class, pick up a new hobby, go on a trip, anything that will get you excited about life again. I welcome your thoughts, let me know if you want to talk more