void Update() { if (firstIngLoaded) { firstImageIng.gameObject.SetActive(true); } else { firstImageIng.gameObject.SetActive(false); } if (secIngLoaded) { secondImageIng.gameObject.SetActive(true); } else { secondImageIng.gameObject.SetActive(false); } if (firstIngLoaded && secIngLoaded) { potImage.gameObject.SetActive(true); CraftingDataBase.PotionsList pot = CraftingDataBase.GetPotionMadeOf(firstIng, secondIng); if (pot != CraftingDataBase.PotionsList.None) { if (CraftingDataBase.DiscoveredThisPotion(pot)) { potImage.texture = CraftingDataBase.GetPotionImage(pot); } else { potImage.texture = unknowImage; } } else { potImage.texture = noneImage; } } else { potImage.gameObject.SetActive(false); } }
public bool AddPotion(CraftingDataBase.PotionsList potion) { if (potion == CraftingDataBase.PotionsList.None) { return(false); } for (int i = 0; i < potsBag.Count; i++) { if (potsBag[i][0] == potion) { potsBag[i].Add(potion); potsHUD.InitializePotionsImage(); return(true); } } List <CraftingDataBase.PotionsList> aux = new List <CraftingDataBase.PotionsList>(); aux.Add(potion); potsBag.Add(aux); potsHUD.InitializePotionsImage(); return(true); }