public void AddPanelItem(PanelLibraryItem.IModel item) { PanelLibraryItem newItem = Instantiate(libraryItemPrefab, libraryUI.libraryContainer); newItem.Setup(item); items.Add(newItem); }
public void AddPanel(PanelLibraryItem.IModel libPanel, bool dragOn) { Util.Log($"KEEP ME adding panel {libPanel.GetTitle()}"); CardPanel.IAssignedPanel panel = libPanel.Assign(); Util.Log($"KEEP ME added panel, ID = {panel.GetId()}"); // Call this last, so it shows the default cards we added right above. panelManager.AddPanel(panel, true /*added from library*/, dragOn); }
public void Setup(IModel model) { this.model = model; image.sprite = model.GetIcon(); titleField.text = model.GetTitle(); descriptionField.text = model.GetDescription(); backgroundImage.color = model.GetColor(); }
void AddPanel(PanelLibraryItem.IModel libPanel, bool dragOn = false) { if (Time.unscaledTime - lastPanelAddTime < 0.5f) { // Weird race conditions can happen in multiplayer, even with no other // players, so prevent this from happening too fast. return; } lastPanelAddTime = Time.unscaledTime; onRequestAddPanel?.Invoke(libPanel, dragOn); Close(); }