Basically. Though a for and foreach loop is a bit redundant. On the for loop there, you could get the array length subtract 1 and plug the result into the last index pin. Likewise, in the construction script, you could use use the array length -1 to set number of floors, and when you add a floor in game, you would add an element to the array for the new floor, then use the new length -1 to update the number of floors var.