public static AmountPopupWindow Create() { if (CurrentWindow != null) { return(CurrentWindow); } AmountPopupWindow prefab = Resources.Load <AmountPopupWindow>("UIPrefabs/AmountConfirmPopup"); GameObject mainCanvas = GameObject.FindWithTag("MainCanvas"); AmountPopupWindow window = Instantiate(prefab); window.transform.SetParent(mainCanvas.transform); window.GetComponent <RectTransform>().anchoredPosition = Vector3.zero; CurrentWindow = window; return(window); }
public void BoostHealth() { AmountPopupWindow.Create().SetUpResourcePopup("Boost the economy", "How many crystals to boost the economy and city health?", ResourceType.Crystal, PlayerData.Instance.GetInventory(), BoostPopupCallback); }
public void Refuel() { AmountPopupWindow.Create().SetUpResourcePopup("Refuel", "Refuel with how many crystals?", ResourceType.Crystal, PlayerData.Instance.GetInventory(), RefuelCallback); }