public void Show(StaticLevel dataStaticLevel, CallbackYes callbackYes, CallbackNo callbackNo) { UserStockData.Load(); this.dataStaticLevel = dataStaticLevel; WhiteBubbleStock = UserStockData.WhiteBubbleStock; RedBubbleStock = UserStockData.RedBubbleStock; OrangeBubbleStock = UserStockData.OrangeBubbleStock; TextWhiteBubble.text = WhiteBubbleStock.ToString(); TextRedBubble.text = RedBubbleStock.ToString(); TextOrangeBubble.text = OrangeBubbleStock.ToString(); this.callbackYes = callbackYes; this.callbackNo = callbackNo; GetComponent <Animator>().SetTrigger("Show"); isShowing = true; MaksBubble = dataStaticLevel.Bubbles.Count; for (int i = 0; i < MaksBubble; i++) { GameObject objek = (GameObject)Instantiate(UndefineBubble); objek.transform.SetParent(PanelPreview.transform); objek.transform.localScale = new Vector3(1, 1, 1); objek.transform.localPosition = new Vector3(objek.transform.localPosition.x, objek.transform.localPosition.y, 0); objek.GetComponent <DropBubbleHandler>().reloadPopupController = this; objek.GetComponent <ItemGelembungController>().Define = false; } WhiteBubbleButton.SetActive(!(WhiteBubbleStock == 0)); RedBubbleButton.SetActive(!(RedBubbleStock == 0)); OrangeBubbleButton.SetActive(!(OrangeBubbleStock == 0)); }
void AfterChangeQuantity() { TextWhiteBubble.text = WhiteBubbleStock.ToString(); TextRedBubble.text = RedBubbleStock.ToString(); TextOrangeBubble.text = OrangeBubbleStock.ToString(); WhiteBubbleButton.SetActive(!(WhiteBubbleStock == 0)); RedBubbleButton.SetActive(!(RedBubbleStock == 0)); OrangeBubbleButton.SetActive(!(OrangeBubbleStock == 0)); ReloadButton.interactable = PanelPreview.transform.childCount > 0; }
public void DeleteCallback(ItemGelembungController itemGel) { if (itemGel.Type == BubbleType.White) { WhiteBubbleStock++; TextWhiteBubble.text = WhiteBubbleStock.ToString(); } else if (itemGel.Type == BubbleType.Red) { RedBubbleStock++; TextRedBubble.text = WhiteBubbleStock.ToString(); } else if (itemGel.Type == BubbleType.Orange) { OrangeBubbleStock++; TextOrangeBubble.text = WhiteBubbleStock.ToString(); } ReloadButton.interactable = PanelPreview.transform.childCount > 0; WhiteBubbleButton.SetActive(!(WhiteBubbleStock == 0)); RedBubbleButton.SetActive(!(WhiteBubbleStock == 0)); OrangeBubbleButton.SetActive(!(WhiteBubbleStock == 0)); }