コード例 #1
0
ファイル: Store.cs プロジェクト: GudrunInga/TheGreatEscape
    // Use this for initialization
    void Start()
    {
        _gravityScript = new AssemblyCSharp.StoreGravity(gravity, buyGravity, currentGravityLevel, increaseGravityButton, decreaseGravityButton);
        _speedScript   = new AssemblyCSharp.StoreSpeed(speed, buySpeed, currentSpeedLevel, increaseSpeedButton, decreaseSpeedButton);

        moveCameraScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Moveright> ();
        _cameraAccScript = new AssemblyCSharp.StoreCameraAcceleration(cameraAcc, buyCameraAcc, currentCameraAccLevel, increaseCameraAccButton, decreaseCameraAccButton, moveCameraScript);

        DisableAllButtons();
        GotMoney();

        if (_firstRun)
        {
            _storeOwnedItems = new List <bool> ();
            InitializeStoreItems();
            InitializeForms();
            InitializeHats();

            _firstRun = false;
        }
        else
        {
            shopScrollList.RefreshDisplay();
        }
        InitializeButtons();

        //Debug.Log ("I am in Store Start " + _firstRun);

        //InitializeItems ();
        //Debug.Log ("Owned forms: " + _ownedForms.Count);
        //Debug.Log ("Store Owned Forms: " + _storeOwnedItems.Count);
    }
コード例 #2
0
    public void TryTransferItemToOtherShop(Item item)
    {
        int randomPriceIncrease = Random.Range(1, 10);

        if (otherShop.gold >= item.price)
        {
            gold           += item.price;
            otherShop.gold -= item.price;

            if (otherShop.name != "Ship Inventory Content")
            {
                RemoveItem(item, this);
                item.price += randomPriceIncrease;
                AddItem(item, otherShop);
            }
            // RemoveItem(item, this);

            if (item.itemName == "Food")
            {
                userStatistics.addFood(Random.Range(1, 100));
            }

            if (item.itemName == "Wood")
            {
                userStatistics.addShipHealth(Random.Range(1, 100));
            }

            RefreshDisplay();
            otherShop.RefreshDisplay();
            Debug.Log("enough gold");

            ItemSelected(item.itemName);
        }
        Debug.Log("attempted");
    }
コード例 #3
0
    public void TryTransferItemToOtherShop(Piatto item)
    {
        AddItem(item, otherShop);
        RefreshDisplay();
        otherShop.RefreshDisplay();

        Debug.Log("attempted");
    }
コード例 #4
0
ファイル: ShopScrollList.cs プロジェクト: Imarion/UnityShopUI
 public void TryTransferItemToOtherShop(Item item)
 {
     if (otherShop.gold >= item.price)
     {
         gold           += item.price;
         otherShop.gold -= item.price;
         AddItem(item, otherShop);
         RemoveItem(item, this);
         RefreshDisplay();
         otherShop.RefreshDisplay();
     }
 }
コード例 #5
0
    private void PopulateItemList()
    {
        List <Item> itemList = new List <Item>();
        var         length   = Random.Range(10, 20);

        for (var i = 0; i < length; i++)
        {
            itemList.Add(itemCreator.GetItem());
        }
        HeroShopScrollList.ItemList = itemList;
        HeroShopScrollList.RefreshDisplay();
        heroItemList = HeroShopScrollList.ItemList;
        hero.WalkToPlayer();
    }
コード例 #6
0
    public void TryTransferItemToOtherShop(Item item)
    {
        if (otherShop.gold >= item.price)
        {
            gold           += item.price;
            otherShop.gold -= item.price;

            AddItem(item, otherShop);
            RemoveItem(item, this);

            RefreshDisplay();
            otherShop.RefreshDisplay();
            Debug.Log("enough gold");
        }
        Debug.Log("attempted");
    }
コード例 #7
0
    public void TryTransferItemToOtherShop(Item item)
    {
        Debug.Log(string.Format("item: {0} - otherShop.gold: {1} - item.price: {2}", item.itemName, otherShop.gold, item.price));


        if (otherShop.gold >= item.price)
        {
            Debug.Log(string.Format("adicionar item ok: {0}", item.itemName));
            gold           += item.price;
            otherShop.gold -= item.price;
            AddItem(item, otherShop);
            RemoveItem(item, this);

            RefreshDisplay();
            otherShop.RefreshDisplay();
        }
    }
コード例 #8
0
    public void TryTransferItemToOtherShop(Item item)
    {
        //Debug.Log("enough gold");
        if (otherShop != null)
        {
            //gold += item.price;
            //otherShop.gold -= item.price;

            AddItem(item, otherShop);
            RemoveItem(item, this);

            RefreshDisplay();
            otherShop.RefreshDisplay();
            //Debug.Log("enough gold");
        }
        //Debug.Log("attempted");
    }
コード例 #9
0
ファイル: ShopOptions.cs プロジェクト: barteq100/RPGMerchant
    private void UpdatePrices()
    {
        bool wasUpdated = false;

        foreach (Item i in PlayerShopScrollList.ItemList)
        {
            if (i.Profit != Profit)
            {
                wasUpdated  = true;
                i.ItemPrice = i.OriginalPrice + (i.OriginalPrice * (Profit / 100f));
                i.Profit    = Profit;
            }
        }
        if (wasUpdated)
        {
            PlayerShopScrollList.RefreshDisplay();
        }
    }
コード例 #10
0
    public void TryTransferFoodItemToOtherShop(FoodObject food)
    {
        food = new FoodObject(food);

        if (otherShop.point >= food.getPrice())
        {
            buyButtonText.text = "Buy";

            point           += food.getPrice();
            otherShop.point -= food.getPrice();

            AddFoodItem(food, otherShop);
            RemoveFoodItem(food, this);

            RefreshDisplay();
            otherShop.RefreshDisplay();
        }
    }
コード例 #11
0
ファイル: ShopScrollList.cs プロジェクト: MoongK/Pooling
    internal void TryTransferItemToOtherShop(Item item)
    {
        if (otherShop.gold >= item.price)
        {
            gold           += item.price;
            otherShop.gold -= item.price;

            AddItem(item, otherShop);
            RemoveItem(item, this);

            RefreshDisplay();
            otherShop.RefreshDisplay();
            print("enough gold");
        }
        else
        {
            print("note enough gold");
        }
    }
コード例 #12
0
 public bool TryTransferItem(Item item)
 {
     if (!ShopOptions.SellingSwitch.isOn)
     {
         return(false);
     }
     if (OtherShop.Player.Gold >= item.ItemPrice)
     {
         Player.Gold           += item.ItemPrice;
         OtherShop.Player.Gold -= (item.ItemPrice - ((float)Negotation.AttributeLvl / 10 * item.ItemPrice));
         AddItem(item, OtherShop);
         RemoveItem(item, this);
         item.ItemPrice = item.OriginalPrice;
         RefreshDisplay();
         OtherShop.RefreshDisplay();
         return(true);
     }
     return(false);
 }
コード例 #13
0
 // Use this for initialization
 void Start()
 {
     stocklist.RefreshDisplay();
 }