Occasional pain in eye in dark?

Hi, Just wondering if anyone can relate to this or advise on it but… Got diagnosed with transverse myelitus a couple of years ago & if another attack ms will then be confirmed… Ive found occasionally at night time when I’m lying in bed in the dark with my eyes open I will get a sharp shooting pain in one eye, it seems to take over the whole of my eye and lasts for a split second then it’s gone. My vision is not affected but it, but the pain is so intense and sudden it makes me shut my eye and screw it up, then it’s gone. Has anyone else had anything like this? Why in the dark? It never happens in the day It’s not all the time but every now an then and it only happens once in one eye. Thank you for any responses or thought. :0)