Unity – is this point within a box?

I am currently using Unity for two weeks and I have started to implement logic and graphical tweaks into mechanics. It happened that I needed a little math to correct some calculation failures based on user mouse or touch input. A simple check was needed – is a given 3D point contained within a box?

I was pretty disappointed that Unity does not have such functions already made. And even more disappointed I couldn’t find ready solution for Unity-specific library code. Actually many folks use Physics.Raycast() instead which is ugly. The sad fact is that many creators do not have any idea what they are doing by using Raycast.

Below you can see the code for such point-box check. If you need it, figure it out yourself how it works.