public void showOder() { numberItemOder = PlayerPrefs.GetInt("level"); if (numberItemOder < 6) { for (int k = numberItemOder; k < 6; k++) { itemOder[k].SetActive(false); } } else { numberItemOder = 6; } if (GameManager.Instance.guide) { numberItemOder = 1; } for (int l = 0; l < 6; l++) { if (l < numberItemOder) { transform.GetChild(l + 6).gameObject.SetActive(true); } else { transform.GetChild(l + 6).gameObject.SetActive(false); } } for (int i = 0; i < numberItemOder; i++) { itemOder[i].SetActive(true); count = 0; ItemOder item = itemOder[i].GetComponent <ItemOder>(); for (int j = 0; j < item.idnsBan.Count; j++) { if (PlayerPrefs.GetInt("ns" + item.idnsBan[j]) - PlayerPrefs.GetInt("numberSell" + i) >= 0) { count++; } } if (count == item.idnsBan.Count && item.idnsBan.Count > 0) { setTickOder(i, true); } else { setTickOder(i, false); } if (check) { itemOder[PlayerPrefs.GetInt("idOder", 0)].GetComponent <ItemOder>().loadItemOder(); } } }
void Start() { Instance = this; initOder(); if (id == 0) { Language.Instance.setNameText("Đơn hàng", "Oder", nameOder); } }
public void buyItemOder() { if (check && !checkCar) { Oder.Instance.checkBan = false; transform.parent.transform.localScale = Vector3.zero; GameManager.Instance.cameraOnOff(false); //ban xong xe chay check = false; checkCar = true; xekhong.SetActive(false); //mo nhac xe o to di StartCoroutine(carRun()); //cho chay time cua oder day ItemOder itemOrder = itemOder.GetComponent <ItemOder>(); itemOrder.buyItemOder(); itemOrder.loadItemOder(); if (GameManager.Instance.guide) { Guide.Instance.openAll(); PlayerPrefs.SetInt("step", 20); } } else { if (checkCar) { Language.Instance.notifyEngOrVi("Car go sell!", "Xe đang trở hàng!"); } else { Language.Instance.notifyEngOrVi("No enough sell!", "Chưa đủ nông sản để bán!"); } } }