private void Update() { if (player.isLocalPlayer) { Vector3 newPosition = player.transform.position; newPosition.y = player.transform.position.y + 10; minimapCamera.transform.position = newPosition; } SetFuelAmount(controller.GetThrusterFuelAmount()); SetHealthAmount(player.GetHealthPct()); SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets); if (Input.GetKeyDown(KeyCode.Escape)) { TogglePauseMenu(); } if (Input.GetKeyDown(KeyCode.Tab)) { scoreboard.SetActive(true); } else if (Input.GetKeyUp(KeyCode.Tab)) { scoreboard.SetActive(false); } }
private void Update() { SetHealthAmount(player.GetHealthPct()); if (!weaponManager.isReloading) { SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets, weaponManager.GetCurrentWeapon().maxBullets); } else { SetAmmoAmount(0, weaponManager.GetCurrentWeapon().maxBullets); } if (Input.GetKeyDown(KeyCode.Tab)) { scoreboard.SetActive(true); } else if (Input.GetKeyUp(KeyCode.Tab)) { scoreboard.SetActive(false); } if (Input.GetKeyDown(KeyCode.R) && !weaponManager.isReloading) { weaponManager.Reload(); } }
void Update() { SetHealthAmount(player.GetHealthPct()); if (Input.GetKeyDown(KeyCode.Q)) { TogglePauseMenu(); } }
private void Update() { SetFuelAmount(controller.GetThrusterFuelAmount()); SetHealthAmount(player.GetHealthPct()); if (Input.GetKeyDown(KeyCode.Escape)) { TogglePauseMenu(); } }
void Update() { SetFuelAmount(controller.GetThrusterFuelAmount()); SetHealthAmount(player.GetHealthPct()); if (weaponManager != null && weaponManager.GetCurrentWeapon() != null) { SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets); } }
void Update() { SetHealthAmount(player.GetHealthPct()); SetFuelAmount(controller.GetThrusterFuelAmount()); SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets); if (Input.GetKeyDown(KeyCode.Escape)) { TogglePauseMenu(); } }
void Update() { SetHealthAmount(player.GetHealthPct()); // Debug.Log(player.GetHealthPct()); SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets); if (Input.GetKeyDown(KeyCode.Escape)) { TogglePauseMenu(); } }
void Update() { SetHealthAmount(player.GetHealthPct()); SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets); if (Input.GetKeyDown(KeyCode.Escape)) { TogglePauseMenu(); } if (Input.GetKeyDown(KeyCode.Tab)) { scoreboard.SetActive(true); } else if (Input.GetKeyUp(KeyCode.Tab)) { scoreboard.SetActive(false); } }
void Update() { SetFuelAmount(controller.GetThrusterFuelAmount()); SetHealthAmount(player.GetHealthPct()); SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets); //Pause by using escape key if (Input.GetKeyDown(KeyCode.Escape)) { TogglePauseMenu(); } //enabling scoreboard view by pressing tab key if (Input.GetKeyDown(KeyCode.Tab)) { scoreboard.SetActive(true); } else if (Input.GetKeyUp(KeyCode.Tab)) { scoreboard.SetActive(false); } }
private void Update() { SetEnduranceAmount(controller.GetEndurancePct()); SetHealthAmount(player.GetHealthPct()); SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets, weaponManager.GetCurrentWeapon().maxBullets); SetCrosshairColor(); UpdateScore(); if (Input.GetKeyDown(KeyCode.Escape)) { TogglePauseMenu(); } if (Input.GetKeyDown(KeyCode.Tab)) { scoreboard.SetActive(true); } else if (Input.GetKeyUp(KeyCode.Tab)) { scoreboard.SetActive(false); } }
void Update() { SetFuelAmount(controller.GetThrusterFuelAmount()); SetHealthAmount(player.GetHealthPct()); SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets); if (Input.GetKeyDown(KeyCode.Escape)) { TogglePauseMenu(); } if (Input.GetKeyDown(KeyCode.Tab)) { scoreboard.SetActive(true); //Debug.Log("Scoreboard is active"); } else if (Input.GetKeyUp(KeyCode.Tab)) { scoreboard.SetActive(false); //Debug.Log("Scoreboard is inactive"); } }
void Update() { SetHealthAmount(player.GetHealthPct()); }
void Update() { SetFuelAmount(_controller.GetThrusterFuelAmount()); SetHealthAmount(_player.GetHealthPct()); SetAmmoAmount(_weaponManager.GetCurrentWeapon().bullets); }
private Player player; // reference to the actual player // Update is called once per frame void Update() { usernameText.text = player.username; //changes the text with the player name healthBarFill.localScale = new Vector3(player.GetHealthPct(), 1f, 1f); // dynamically changes the bar status over the player }
// Update is called once per frame void Update() { usernameText.text = player.username; healthBarFill.localScale = new Vector3(player.GetHealthPct(), 1f, 1f); }
private void Update() { healthbarfill.localScale = new Vector3(1f, player.GetHealthPct(), 1f); }
void Update() { SetFuelAmount(controller.GetThrusterFuelAmount()); SetHealthAmount(player.GetHealthPct()); }