Just remember each company has to have so many shareholders, so if you leave the company may need to find another person, but the lawyer will advise you/them on this. You are a Director because you are a shareholder, so you can resign from that position anytime.
But as also advised above, you must have a Lawyer sort this out, to be safe and legal.
Good luck.