I will append my opinion here, because parent is probably the only comment that mentions licensing.
Can't believe the licensing option wasn't mentioned more in this discussion - if you've got a killer IP, then approach the MegaCorp's competitors, and offer non-exclusive licensing deals to the MegaCorp *and* their competitors, at the same time.
That will make them think twice about developing the product themselves from scratch and losing the edge during that time.
Put the first money you make towards a patent application, assuming you are a prior (first) art.
Don't sell out in these times, if you've got a place to live and something to eat, the money is just a piece of paper. Money can dramatically devalue from one day to another, MegaCorps can fall or downsize to the bone.
It all depends on whether you really believe in your idea.