/// <summary> /// Sets "ItemData.SHOPITEM.payableData.state". Don't use for non-ShopItemDatas like MapType. /// </summary> /// <param name="state">Beware, returns an exception if a MapType calls method.</param> /// <seealso cref="Item"/> public void SetShopItemState(ShopItemState state) { switch (data.type) { case ItemType.Map: throw new System.Exception("Item:Data.ItemType is inappropriate. Read the summary of function."); case ItemType.Body: data.bodyData.payableData.state = state; break; case ItemType.Extra: data.extraData.payableData.state = state; break; case ItemType.Special: data.specialData.payableData.state = state; break; case ItemType.Flag: break; default: throw new System.Exception("ShopItemData.Type is inappropriate."); } }
private void SetItemState(ShopItemState state) { _currentState = state; _priceText.gameObject.SetActive(state <= ShopItemState.Affordable); _currencyImage.gameObject.SetActive(state <= ShopItemState.Affordable); switch (state) { case ShopItemState.TooExpensive: _itemButton.image.color = _tooExpensiveColor; break; case ShopItemState.Affordable: _itemButton.image.color = _affordableColor; break; case ShopItemState.Bought: _itemButton.image.color = _boughtColor; break; case ShopItemState.Selected: _itemButton.image.color = _selectedColor; break; default: throw new ArgumentOutOfRangeException(nameof(state), state, null); } }
public void Init(ShopItemState shopItemState, int price, Sprite sprite, int index) { this.id = index; cardbackImage.sprite = sprite; this.price = price; SetState(shopItemState); }
internal void SetShopItemState(ShopItemState shopItemState) { switch (shopItemState) { case ShopItemState.IN_USE: holderImage.color = IN_USE_COLOR; contentPriceText.text = "USING"; break; case ShopItemState.OWNED: holderImage.color = OWNED_COLOR; contentPriceText.text = "OWNED"; break; case ShopItemState.NORMAL: holderImage.color = NORMAL_COLOR; break; } CurrentState = shopItemState; }
public void SetState(ShopItemState shopItemState) { State = shopItemState; switch (shopItemState) { case ShopItemState.Locked: stateView.Background.color = Color.red; stateView.Desc.text = price + "$"; break; case ShopItemState.Unlocked: stateView.Background.color = Color.green; stateView.Desc.text = "available"; break; case ShopItemState.Set: stateView.Background.color = Color.yellow; stateView.Desc.text = "used"; break; } }
internal CoreSkinData(string _skinName, ShopItemState _skinState) { skinName = _skinName; skinState = _skinState; }