public void SelectGrowroomEvent(DispensaryEventReference newGrowroomEvent) { selectedGrowroomItems.gameObject.SetActive(true); notSelectedGrowroomItems.gameObject.SetActive(false); selectedGrowroomEvent = newGrowroomEvent; smokeLoungeEventTitleText.text = newGrowroomEvent.eventName; }
public void CreateGrowroomEventsList() { foreach (Image displayed in displayedGrowroomEvents) { Destroy(displayed.gameObject); } displayedGrowroomEvents.Clear(); List <DispensaryEventReference> growroomEvents = dm.database.GetGrowroomEventReferences(); float prefabHeight = growroomEventPrefab.rectTransform.rect.height; for (int i = 0; i < growroomEvents.Count; i++) { int temp = i; DispensaryEventReference thisReference = growroomEvents[temp]; Image newGrowroomEventDisplay = Instantiate(growroomEventPrefab); newGrowroomEventDisplay.gameObject.SetActive(true); Text[] childText = newGrowroomEventDisplay.GetComponentsInChildren <Text>(); childText[0].text = thisReference.eventName; newGrowroomEventDisplay.transform.SetParent(glassShopEventsContentPanel.transform, false); newGrowroomEventDisplay.rectTransform.anchoredPosition = new Vector2(0, -i * prefabHeight); displayedGrowroomEvents.Add(newGrowroomEventDisplay); } }
public void SelectEventType(string newSelectedTypeString) { HideEventTypeDescriptions(); ClearEventSchedulerPanel(); switch (newSelectedTypeString) { case "delivery": if (deliveryEventTypeDisplay.selected) { deliveryEventTypeDisplay.Deselect(); LoadEventScheduler(); } else { selectedOrderPreset = null; deliveryEventItems.gameObject.SetActive(true); deliveryEventTypeDisplay.SetToSelected(); smokeLoungeEventTypeDisplay.Deselect(); glassShopEventTypeDisplay.Deselect(); growroomEventTypeDisplay.Deselect(); if (selectedOrderPreset != null) { selectedOrderPresetItems.gameObject.SetActive(true); notSelectedOrderPresetItems.gameObject.SetActive(false); } else { selectedOrderPresetItems.gameObject.SetActive(false); notSelectedOrderPresetItems.gameObject.SetActive(true); } deliveryEventTitleText.text = "Schedule a Delivery Event"; CreateOrderPresetsList(); } break; case "smokeLounge": if (smokeLoungeEventTypeDisplay.selected) { smokeLoungeEventTypeDisplay.Deselect(); LoadEventScheduler(); } else { selectedSmokeLoungeEvent = null; smokeLoungeEventItems.gameObject.SetActive(true); deliveryEventTypeDisplay.Deselect(); smokeLoungeEventTypeDisplay.SetToSelected(); glassShopEventTypeDisplay.Deselect(); growroomEventTypeDisplay.Deselect(); if (selectedSmokeLoungeEvent != null) { selectedSmokeLoungeItems.gameObject.SetActive(true); notSelectedSmokeLoungeItems.gameObject.SetActive(false); } else { selectedSmokeLoungeItems.gameObject.SetActive(false); notSelectedSmokeLoungeItems.gameObject.SetActive(true); } smokeLoungeEventTitleText.text = "Schedule a Smoke Lounge Event"; CreateSmokeLoungeEventsList(); } break; case "glassShop": if (glassShopEventTypeDisplay.selected) { glassShopEventTypeDisplay.Deselect(); LoadEventScheduler(); } else { selectedGlassShopEvent = null; glassShopEventItems.gameObject.SetActive(true); deliveryEventTypeDisplay.Deselect(); smokeLoungeEventTypeDisplay.Deselect(); glassShopEventTypeDisplay.SetToSelected(); growroomEventTypeDisplay.Deselect(); if (selectedGlassShopEvent != null) { selectedGlassShopItems.gameObject.SetActive(true); notSelectedGlassShopItems.gameObject.SetActive(false); } else { selectedGlassShopItems.gameObject.SetActive(false); notSelectedGlassShopItems.gameObject.SetActive(true); } glassShopEventTitleText.text = "Schedule a Glass Shop Event"; CreateGlassShopEventsList(); } break; case "growroom": if (growroomEventTypeDisplay.selected) { growroomEventTypeDisplay.Deselect(); LoadEventScheduler(); } else { selectedGrowroomEvent = null; growroomEventItems.gameObject.SetActive(true); deliveryEventTypeDisplay.Deselect(); smokeLoungeEventTypeDisplay.Deselect(); glassShopEventTypeDisplay.Deselect(); growroomEventTypeDisplay.SetToSelected(); if (selectedGrowroomEvent != null) { selectedGrowroomItems.gameObject.SetActive(true); notSelectedGrowroomItems.gameObject.SetActive(false); } else { selectedGrowroomItems.gameObject.SetActive(false); notSelectedGrowroomItems.gameObject.SetActive(true); } growroomEventTitleText.text = "Schedule a Growroom Event"; CreateGrowroomEventsList(); } break; } UpdateEventTypeButtons(); }