public void PotionAction() { if (potionAmount <= 0) { scenesController.LoadScene(ScenesEnum.store); return; } etherActive = false; DeactivateAll(); // if button is clicked again while potion is active then deactive potion potionActive = !potionActive; if (assassinHealable) { UpdateAssassinBoarderAndButton(potionActive); } if (guardianHealable) { UpdateGuardianBoarderAndButton(potionActive); } if (wizardHealable) { UpdateWizardBoarderAndButton(potionActive); } }
public void BackPackButtonAction() { if (backpackStoreButtonText.text.Equals("Store")) { scenesController.LoadScene(ScenesEnum.store); } else { scenesController.LoadScene(ScenesEnum.backpack); } }
public void Clicked() { if (Vector3.Distance(gameObject.transform.position, characterController.gameObject.transform.position) <= clickDistance) { // keep the gameobject GameObject enemySelected = GameObject.Find("Enemy Selected"); if (enemySelected != null) { Destroy(enemySelected); } enemySelected = new GameObject("Enemy Selected"); gameObject.transform.parent = enemySelected.transform; DontDestroyOnLoad(enemySelected); // Update the game manager with the selected enemy Enemy e = gameObject.GetComponent <Enemy>(); GameManager.Instance.SelectedEnemy = e; // Load the qr scene ScenesController scenesController = FindObjectOfType <ScenesController>() as ScenesController; scenesController.LoadScene(ScenesEnum.scanner); } }
public void LoadBattleScene(QRCode code, string reply) { message.text = reply; if (code != null) { if (GameManager.Instance.SelectedEnemy.code.QRCodeID.Equals(code.QRCodeID)) { StopCamera(); enemyFound = true; scenesController.LoadScene(ScenesEnum.battlescene); } else { message.text = "QR Code Not Locked To This Location"; } } }
public IEnumerator WaitToChangeScene() { yield return(new WaitForSeconds(waitTime)); anim.SetTrigger("Start"); yield return(new WaitForSeconds(2.067f)); scenesController.LoadScene(2); }
void Update() { if (startCountDown) { timeleft -= Time.deltaTime; } if (timer < 0 || winnerId != -1) { startCountDown = true; //add points, reload scene ChangePoints(winnerId); //reference winner player if (Convert.ToInt32(p1Points[0].text) >= maxRounds || Convert.ToInt32(p2Points[0].text) >= maxRounds) { if (timeleft <= 0) { scenesController.LoadScene(0); } sOScores.p1Score = 0; sOScores.p2Score = 0; winnerId = -1; looserId = -1; } else { if (timeleft <= 0) { scenesController.LoadScene(2); } winnerId = -1; looserId = -1; } } else { timer -= Time.deltaTime; } textTimer.text = (timer).ToString("0"); }
public void LoadScene(int index) { scenesController.LoadScene(index); //this shall depend on the duelCase state }
// Map public void MainMenuClicked() { sceneController.LoadScene(ScenesEnum.mainmenu); }