Depressed during pregnancy

If you are depressed, unhappy and under an incredible amount of stress to the point you can barely enjoy being pregnant, will it effect your baby? I don’t want to be causing future problems for my little one just because I’m going through a very hard time. Any advice?