public bool configure(StoreItemStruct storeItemStruct) { init(); weaponCode = storeItemStruct.weaponCode; quality = storeItemStruct.quality; style = storeItemStruct.style; price = storeItemStruct.price; name = storeItemStruct.name; priceText.text = LanguageSystem.GET_CURRENCY() + price; weaponName.text = name; frame.color = arraysData.qualityColors[quality]; image.sprite = getImg(weaponCode, style); if (haveBought()) { disableButton(); } if (price <= 0) { Destroy(gameObject); return(false); } return(true); }
public void show(int weaponCode, int style, string playersName) { Debug.Log("weaponCode: " + weaponCode + " style: " + style); arraysData = GameObject.Find(MainMenu.ArraysDataName).GetComponent <ArraysData>(); StoreItemStruct itemStruct = InventoryMenu.getStruct(listWeapon, weaponCode, style); image.sprite = getSprite(weaponCode, style); qualityLine.color = arraysData.qualityColors[itemStruct.quality]; weaponName.text = itemStruct.name; title.text = LanguageSystem.GET_SHOW_WEAPON_PANEL_TITLE_START() + " " + playersName + LanguageSystem.GET_SHOW_WEAPON_PANEL_TITLE_MIDDLE() + " " + LanguageSystem.GET_SHOW_WEAPON_PANEL_TITLE_END(); }
private void refreshKnife() { if (countOfZeus > 0) { changeKnife(0); return; } StoreItemStruct knifeStruct = InventoryMenu.getStruct(weaponList, 1, getKnifePlayerPrefs()); changeKnife(knifeStruct.iconId); }
public void configure(StoreItemStruct storeItemStruct, char eqTeam) { init(); team = storeItemStruct.team; weaponCode = storeItemStruct.weaponCode; style = storeItemStruct.style; quality = storeItemStruct.quality; equipWeapon('-'); equipWeapon(eqTeam); image.sprite = getImg(weaponCode, style); qualityLine.color = arraysData.qualityColors[quality]; weaponName.text = storeItemStruct.name; }
public static StoreItemStruct getStruct(TextAsset weaponList, int weaponCode, int style) { string[] arr = weaponList.text.Split('\n'); StoreItemStruct itemStruct; for (int i = 1; i < arr.Length; i++) { itemStruct = new StoreItemStruct(arr[i]); if (itemStruct.style == style && itemStruct.weaponCode == weaponCode) { return(itemStruct); } } return(new StoreItemStruct()); }