Sadly, idk the answer to how not to dissociate, I do it too, most times unawares. When lost in the abyss of a depressive episode, I actively disengage from everyone except my daughter, and even remaining engaged with her is hard.
My friends, family and bf know I do this, in fact my bf suffers from bouts of depression and does this too. So during these times we just give each other a respectable amount of space...
I can only commiserate sorry, I have no answers