예제 #1
0
    public ConfimationPopUp DisplayConfirmation(string m, string title = "")
    {
        GameObject       pop = Instantiate(confirmationPopUp, transform.position, Quaternion.identity, transform);
        ConfimationPopUp p   = ConfimationPopUp.CreatePopUp(pop, m, title);

        return(p);
    }
예제 #2
0
    public static ConfimationPopUp CreatePopUp(GameObject where, string m, string title = "")
    {
        where.SetActive(false);
        ConfimationPopUp myC = where.AddComponent <ConfimationPopUp>();

        myC.Title = title;
        myC.Msg   = m;
        where.SetActive(true);

        return(myC);
    }
예제 #3
0
    void ValidateStorage(ShopSlot slot)
    {
        ShopItem item = slot.Item;

        if (!soldItems.Contains(item.Id))
        {
            ConfimationPopUp confimation = DisplayBuyConfirmation(item);
            confimation.OnConfirm += () => { Buy(slot); };
        }
        else
        {
            SelectedShopSlot = slot;
            if (OnSlotSelected != null)
            {
                OnSlotSelected(slot);
            }
        }
    }
예제 #4
0
    void UpgradeValidation()
    {
        ShopItem item = SelectedShopSlot.Item;

        if (item is WeaponShopItem)
        {
            WeaponShopItem weaponShopItem = item as WeaponShopItem;
            Weapon         weapon         = FindWeaponInPlayerInventory(weaponShopItem.WeaponID);
            if (weapon != null)
            {
                if (weapon.info.Level < 10)
                {
                    int Price = CheckUpgradePrice(weapon);
                    ConfimationPopUp confimation = DisplayBuyConfirmation(weapon.info.name + " Upgrade", Price);
                    confimation.OnConfirm += () => { Upgrade(weapon); };
                }
            }
        }
    }