// 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); }
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"); }
public void TryTransferItemToOtherShop(Piatto item) { AddItem(item, otherShop); RefreshDisplay(); otherShop.RefreshDisplay(); Debug.Log("attempted"); }
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(); } }
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(); }
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"); }
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(); } }
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"); }
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(); } }
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(); } }
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"); } }
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); }
// Use this for initialization void Start() { stocklist.RefreshDisplay(); }