Improved the way to gather the number of Unity's Layers. Created an static class which calculates that number once and then cache the value