/// <summary> /// /// </summary> private void On_Slot_PointerUp(BaseEventData data, RecipeSlot slot) { bool shouldOpenUp = !InventoryController.Instance.IsClosed && EventSystem.current.currentSelectedGameObject == slot.gameObject; if (shouldOpenUp) { if (m_Window) { m_Window.Open(); } InspectedSlot = slot; m_InspectedItem = slot.Result; m_CurrentDesiredAmount = 1; ShowRecipeInfo(m_InspectedItem); slot.E_Deselect += On_Slot_Deselect; } else { On_Slot_Deselect(data, slot); } }
/// <summary> /// /// </summary> private IEnumerator C_CheckNextSelection() { yield return(null); RecipeSlot selectedSlot = null; var currentSelected = EventSystem.current.currentSelectedGameObject; if (currentSelected) { selectedSlot = currentSelected.GetComponent <RecipeSlot>(); } if (!currentSelected || !selectedSlot) { if (m_Window) { m_Window.Close(); } InspectedSlot = null; } }
/// <summary> /// /// </summary> private void On_Slot_Deselect(BaseEventData data, RecipeSlot deselectedSlot) { StartCoroutine(C_CheckNextSelection()); }