void MakeSlots() { int count = getHighestSlotCount(); Slots = new List <UI_SquadSlot>(); List <Unlockable <SquadSizeConfig> > sizes = new List <Unlockable <SquadSizeConfig> >(SquadManager.Instance.GetSquadSizeUnlockes()); Unlockable <SquadSizeConfig> current = sizes[0]; for (int i = 0; i < count; i++) { if (i == current.Item.Size) { sizes.Remove(current); if (sizes.Count > 0) { current = sizes[0]; } } Slots.Add(UI_SquadSlot.MakeSlot(current, target.transform)); } }
public static UI_SquadSlot MakeSlot(Unlockable <SquadSizeConfig> config, Transform target) { GameObject prefab = Resources.Load("UI/ui_squad_slot") as GameObject; UI_SquadSlot slot = prefab.Instantiate <UI_SquadSlot>(target, true); slot.SetItem(config); return(slot); }
void OnRemove(UI_SquadSlot view) { }