poopipe left out one major factor though. I don't recall the technical term but every bullet has certain flight characteristics that will not only effect when and and at what rate it will drop, but also how much it may rise. So if you buy a box of rifle rounds, oftentimes there will be a chart on the back or the side that…
It seems you are wanting to look at actual code snippets? Again, this is an artist forum with probably only a handful of experienced programmers. You'll probably find more solutions if you take the question to a more appropriate forum, like the Unity forum or maybe some programmers reddit channels, etc.