private void AddThreadToSlots(AllyInfo parent, ThreadButtonGroup group) { var newEthread = Instantiate(group.threadPrefab, new Vector2(0, 0), Quaternion.identity); newEthread.transform.SetParent(parent.threadCapacityGroup); parent.capacity.Add(newEthread); RefreshSlots(parent); partyInfoDict[parent].GetComponent <GridEntity>().equippedThreads.Add(newEthread.GetComponent <Ethread>()); group.quantity--; }
private void RemoveThreadFromSlot(int index, AllyInfo parent, ThreadButtonGroup group) { var ethreadToRemove = parent.capacity[index]; parent.capacity.Remove(ethreadToRemove); RefreshSlots(parent); partyInfoDict[parent].GetComponent <GridEntity>().equippedThreads.Remove(ethreadToRemove.GetComponent <Ethread>()); Destroy(ethreadToRemove); group.quantity++; }