Exemplo n.º 1
0
	public void init(ITMItem aItem) {
		_itemRef = aItem;
		itemTitle.text = aItem.Name();
		itemDescription.text = aItem.Description();
		if(aItem.SoftCost()>0) {
			itemCost.text = aItem.SoftCost().ToString();
			bagIcon.spriteName = "terracoins";
		} else {
			itemCost.text = aItem.HardCost().ToString();
			bagIcon.spriteName = "terradollars";
		}
		
		
		/*
		UISprite newSprite = aItem.Sprite();
		if(newSprite!=null) {
			
			Destroy (itemSprite);
			itemSprite = newSprite;
			newSprite.transform.parent = currentParent;
			newSprite.transform.localScale = currentScale;
			newSprite.transform.position = new Vector3(0f,0f,0f);
			newSprite.transform.localPosition = new Vector3(0f,0f,0f);
			newSprite.depth = currentSpriteOrder;
		}*/
		itemTexture.mainTexture = aItem.texture();
		amountOwned.text = PlayerMain.REF.amountOwned(aItem).ToString();
	}
Exemplo n.º 2
0
		public void initButton(ITMItem aItem) {
			itemTitle.text = aItem.Name();

			_item = aItem;
			active = true;
			if(itemBagLabel==null) {
				itemBagLabel = this.transform.FindChild("Price Container").FindChild("TerraCoinImg").gameObject.GetComponent<UISprite>();
			}
			if(itemCost==null) {
				itemCost = this.transform.FindChild("Price Container").FindChild("TerraCoinValue").gameObject.GetComponent<UILabel>();
			}
			itemSprite = this.GetComponentInChildren<UITexture>();
			itemSprite.mainTexture = aItem.texture();
			
			if(aItem.SoftCost()>0) {
				itemCost.text = aItem.SoftCost().ToString();
				itemBagLabel.spriteName = "terracoins";
			} else {
				itemCost.text = aItem.HardCost().ToString();
				itemBagLabel.spriteName = "terradollars";
			}
		}
Exemplo n.º 3
0
		public bool canBuyItem(ITMItem aItem) {
			return this.softCurrency>=aItem.SoftCost()&&this.hardCurrency>=aItem.HardCost();
		}