Example #1
0
    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);
    }
Example #2
0
 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);
 }
Example #3
0
 public void Refuel()
 {
     AmountPopupWindow.Create().SetUpResourcePopup("Refuel", "Refuel with how many crystals?", ResourceType.Crystal, PlayerData.Instance.GetInventory(), RefuelCallback);
 }