public void ReceiveAllSword() { EquipDatabase ed = GetComponent <EquipDatabase>(); ed.ReadAll(); //ed.input = txtED.text; //ed.ReadAllNew(ed.input); int sword = -3; for (int i = 0; i < ed.line.count; i++) { if (ed.line.id[i] == 0) { sword = sword + 4; ed.line.id[i] = sword; ed.line.quantity[i] = ed.line.quantity[i] + 1; ed.Change(i, sword, ed.line.quantity[i]); noticeMain.SetText(noticeMain.text + "- Receive " + line.name[sword] + "!\n"); //Debug.Log(ed.line.id[i].ToString() +" " + ed.line.quantity[i]); } if (sword > 20) { break; } } //Debug.Log("tang len ."); }
public void ReceiveAllShoe() { EquipDatabase ed = GetComponent <EquipDatabase>(); ed.ReadAll(); //ed.input = txtED.text; //ed.ReadAllNew(ed.input); int shoe = 0; for (int i = 0; i < ed.line.count; i++) { if (ed.line.id[i] == 0) { shoe = shoe + 4; ed.line.id[i] = shoe; ed.line.quantity[i] = ed.line.quantity[i] + 1; ed.Change(i, shoe, ed.line.quantity[i]); noticeMain.SetText(noticeMain.text + "- Receive " + line.name[shoe] + "!\n"); //Debug.Log(ed.line.id[i].ToString() +" " + ed.line.quantity[i]); } if (shoe > 23) { break; } } }
public void ReceiveSupport() { EquipDatabase ed = GetComponent <EquipDatabase>(); ed.ReadAll(); //ed.input = txtED.text; //ed.ReadAllNew(ed.input); for (int i = 0; i < ed.line.count; i++) { if (ed.line.id[i] == 0) { ed.line.id[i] = i; ed.line.quantity[i] = ed.line.quantity[i] + 100; ed.Change(i, i, ed.line.quantity[i]); noticeMain.SetText(noticeMain.text + "- Receive " + line.name[i] + "!\n"); //Debug.Log(ed.line.id[i].ToString() +" " + ed.line.quantity[i]); } } ed.line.quantity[32] += 1000000; ed.line.quantity[33] += 1000000; ed.Change(32, 32, ed.line.quantity[32]); ed.Change(33, 33, ed.line.quantity[33]); noticeMain.SetText(noticeMain.text + "- Receive 1,000,000 Gold!\n"); noticeMain.SetText(noticeMain.text + "- Receive 1,000,000 Point!\n"); }
public void ReceiveAllClothes() { EquipDatabase ed = GetComponent <EquipDatabase>(); ed.ReadAll(); //ed.input = txtED.text; //ed.ReadAllNew(ed.input); int clothes = -2; for (int i = 0; i < ed.line.count; i++) { if (ed.line.id[i] == 0) { clothes = clothes + 4; ed.line.id[i] = clothes; ed.line.quantity[i] = ed.line.quantity[i] + 1; ed.Change(i, clothes, ed.line.quantity[i]); noticeMain.SetText(noticeMain.text + "- Receive " + line.name[clothes] + "!\n"); //Debug.Log(ed.line.id[i].ToString() +" " + ed.line.quantity[i]); } if (clothes > 21) { break; } } }
public void ReceiveAllHat() { EquipDatabase ed = GetComponent <EquipDatabase>(); ed.ReadAll(); //ed.input = txtED.text; //ed.ReadAllNew(ed.input); int hat = -1; for (int i = 0; i < ed.line.count; i++) { if (ed.line.id[i] == 0) { hat = hat + 4; ed.line.id[i] = hat; ed.line.quantity[i] = ed.line.quantity[i] + 1; ed.Change(i, hat, ed.line.quantity[i]); noticeMain.SetText(noticeMain.text + "- Receive " + line.name[hat] + "!\n"); //Debug.Log(ed.line.id[i].ToString() +" " + ed.line.quantity[i]); } if (hat > 22) { break; } } }
public void checkItem() { EquipDatabase ed = GetComponent <EquipDatabase>(); ed.ReadAll(); int item = PlayerPrefs.GetInt("item"); int idItem = getIDItem(item); int quantityItem = getQuantity(item); if (idItem == 0 || quantityItem == 0) { Debug.Log(item.ToString()); Menu.SetActive(false); return; } id = ed.line.id[item]; quantity = ed.line.quantity[item]; tmpDes.SetText(line.name[id] + "\nQuantity: " + quantity.ToString()); if (txtBtnShortcut[idItem] == "") { txtBtn.SetText(""); } else { txtBtn.SetText(txtBtnShortcut[idItem]); } oldImage = objItem.GetComponent <Image>(); //Debug.Log(quantity.ToString()); newImage = imageItem[id].GetComponent <Image>(); //Debug.Log(newImage); oldImage.sprite = newImage.sprite; }
private void UpdataItem(int _id) { ed = GetComponent <EquipDatabase>(); if (ed.input == null || ed.input == "") { return; } ed.ReadAll(); // <-- thiếu mỗi nó @@ :v đỉnh kao IEUpdate(_id); }
public void Use() { int item = PlayerPrefs.GetInt("item"); int idItem = getIDItem(item); int quantityItem = getQuantity(item); EquipDatabase ed = GetComponent <EquipDatabase>(); ed.Change(item, idItem, quantityItem - 1); ed.ReadAll(); }
public void HotkeyUse(int _idItem) { EquipDatabase ed = GetComponent <EquipDatabase>(); int item = 0; for (int i = 0; i < 34; i++) { if (ed.line.id[i] == _idItem) { item = ed.line.item[i]; //Debug.Log(item + " " + ed.line.item[i] + " " + getQuantity(item).ToString()); break; } } ed.Change(item, _idItem, getQuantity(item) - 1); ed.ReadAll(); UseItem(_idItem); }
// Update is called once per frame void Update() { StartCoroutine(UpdateScore()); ed.ReadAll(); }