void CheckVechaleLockStats() { if (PlayerPrefs.GetInt("currentVehicle" + currentVehicle) == 1) { BuyWacthBtn.SetActive(false); BuyBtn.SetActive(false); LockBtn.SetActive(false); PlayBtn.SetActive(true); } else { BuyBtn.SetActive(true); LockBtn.SetActive(true); PlayBtn.SetActive(false); int[] price = { 0, 5000, 10000, 15000, 20000, 30000, 40000, 50000, 60000, 70000, 80000 }; BuyPrice = price[currentVehicle]; BuyPrefab = "currentVehicle" + currentVehicle.ToString(); BuyPriceText.text = BuyPrice.ToString(); } checkColorLockStats(); checkDecalLockStats(); checkRimsLockStats(); StartVehicleStats(); }
//Logout Button private void LockBtn_Click(object sender, EventArgs e) {//Hiding all Ui elements UserLabel.Hide(); UserBtn.Hide(); DetectBtn.Hide(); TrainBtn.Hide(); LockBtn.Hide(); ExitBtn.Hide(); mark2.Hide(); LoginPanel.Show(); LoginPanel.Dock = DockStyle.Fill; LoginPanel.BringToFront(); NameBox.Text = ""; PassBox.Text = ""; }
public void CheckIAPAll() { if (PlayerPrefs.GetInt("purchased_all_paints") == 1) { for (int v = 0; v < playerVehicles.Length; v++) { for (int i = 0; i < ColorLock.Length; i++) { ColorLock[i].SetActive(false); PlayerPrefs.SetInt("Vehicle" + v + "Color" + i, 1); } } BuyBtn.SetActive(false); BuyWacthBtn.SetActive(false); PlayBtn.SetActive(true); LockBtn.SetActive(false); } if (PlayerPrefs.GetInt("purchased_all_rims") == 1) { for (int v = 0; v < playerVehicles.Length; v++) { for (int i = 0; i < RimLock.Length; i++) { RimLock[i].SetActive(false); PlayerPrefs.SetInt("Vehicle" + v + "Rim" + i, 1); } } BuyBtn.SetActive(false); BuyWacthBtn.SetActive(false); PlayBtn.SetActive(true); LockBtn.SetActive(false); } if (PlayerPrefs.GetInt("purchased_all_parado") == 1) { for (int i = 0; i < playerVehicles.Length; i++) { PlayerPrefs.SetInt("currentVehicle" + i, 1); } BuyWacthBtn.SetActive(false); BuyBtn.SetActive(false); PlayBtn.SetActive(true); LockBtn.SetActive(false); } }
//Submit Button private async void SigninBtn_Click(object sender, EventArgs e) { //Check if Id and password are not empty if (NameBox.Text != "" && PassBox.Text != "") { //If Login Case if (SigninBtn.ButtonText == "Login") { //DOLOGIN : by Sending user and pw to reader Class of data base SignInResult resutl = LoginSys.SignIn(NameBox.Text, PassBox.Text); if (resutl.LoggedIn) { //If Login Operation Successfull , Show the Ui LoginPanel.Dock = DockStyle.None; LoginPanel.Hide(); LoginPanel.SendToBack(); UserLabel.Show(); UserBtn.Show(); DetectBtn.Show(); TrainBtn.Show(); LockBtn.Show(); ExitBtn.Show(); mark2.Show(); UserLabel.Text = resutl.UserData.Name.ToUpperInvariant(); DetectionPanel.Show(); } else { label3.Text = resutl.Reason; } } else { //If Registration Senario : Sending User and pw to Writer Class bool suResult = await LoginSys.SignUp(NameBox.Text, PassBox.Text, "", 0); if (suResult) { label3.Text = "Registration Done Sucessfully"; } } } }
public void BuyBtnFun(string CallerName) { if (PlayerPrefs.GetInt("cash") >= BuyPrice || CallerName == "WacthVideo") { if (CallerName != "WacthVideo") { PlayerPrefs.SetInt("cash", PlayerPrefs.GetInt("cash") - BuyPrice); main_menu.instance.ShowCash(); } PlayerPrefs.SetInt(BuyPrefab, 1); if (BuyPrefab == "Vehicle" + currentVehicle + "Rim" + BuyIndex) { checkRimsLockStats(); SelectRims(BuyIndex); } else if (BuyPrefab == "Vehicle" + currentVehicle + "Color" + BuyIndex) { checkColorLockStats(); SelectColor(BuyIndex); } else if (BuyPrefab == "Vehicle" + currentVehicle + "Decal" + BuyIndex) { checkDecalLockStats(); SelectDecals(BuyIndex); } BuyBtn.SetActive(false); BuyWacthBtn.SetActive(false); PlayBtn.SetActive(true); LockBtn.SetActive(false); } else { PanalOpen(NotEnoughCoins); } }