Who said being "nice" and having a good attitude where the same thing? Sounds like you do have a bad attitude not in the Hell's Angels way but in the "I don't actually give a shit any more so lets do whatever" sort of way. An engineer with a good attitude will actually give a shit about the quality and type work they do.
>Death doesn't seem so bad anymore.
Sounds like the start of a bout of burn out or depression, you should look into that.
For things to do:
Get a non-technical hobby that can take your mind of work Judo, Yoga, Meditation anything that takes a lot of focus to do right but won't kill you if you do it wrong aka no chainsaw juggling.
Exercise more try to hit an hour a day, it will help calm your mind and improve your mood. Swing by /r/bodyweightfitness learn how to do cool gymnastics stuff.
See a shrink. Even if you aren't crazy it can help to have a neutral third party to talk to especially one with skills.