public void ClearBuildingModules() { foreach (GameObject go in mSlots) { BuildingSlot slot = go.GetComponent <BuildingSlot>(); slot.ClearSlot(); } mEmptySlots = mBuildingWidth * mBuildingHeight; // reinit to empty }