private void SetSelectedPanel(CustomerOrderPanel panel) { if (panel != _selectedOrderPanel) { if (_selectedOrderPanel != null) { _selectedOrderPanel.SetHighlightEnabled(false); } if (panel != null) { panel.SetHighlightEnabled(true); } _selectedOrderPanel = panel; } else { if (_selectedOrderPanel != null) { _selectedOrderPanel.SetHighlightEnabled(false); _selectedOrderPanel = null; } } if (_outHatchController != null) { bool bOpenHatch = _selectedOrderPanel != null; _outHatchController.SetOpenState(bOpenHatch); } }
void SpawnOrderPanel(CustomerOrder Order) { // Create a panel at the initial location for them GameObject orderPanelObject = (GameObject)Instantiate(OrderPanelPrefab, PanelListStartAnchor.position, PanelListStartAnchor.rotation); CustomerOrderPanel orderPanelComponent = orderPanelObject.GetComponent <CustomerOrderPanel>(); if (orderPanelComponent != null) { orderPanelComponent.AssignCustomerOrder(Order, false); _customerOrderPanelList.Add(orderPanelObject); } }
public void OnOrderPanelClicked(CustomerOrderPanel panel) { SetSelectedPanel(panel); }