public void Initialize(RealmInventoryWindow realmInventory) { RectTransform = GetComponent <RectTransform>(); InventorySlots = new List <InventorySlot>(GetComponentsInChildren <InventorySlot>()); for (int i = 0; i < InventorySlots.Count; i++) { InventorySlots[i].Initialize(realmInventory); InventorySlots[i].onDropIn += InventoryRow_onDropIn; InventorySlots[i].onDropOut += InventoryRow_onDropOut; } }