GetHealthPct() public method

public GetHealthPct ( ) : float
return float
Beispiel #1
0
    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);
        }
    }
Beispiel #2
0
    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();
        }
    }
Beispiel #3
0
    void Update()
    {
        SetHealthAmount(player.GetHealthPct());

        if (Input.GetKeyDown(KeyCode.Q))
        {
            TogglePauseMenu();
        }
    }
Beispiel #4
0
 private void Update()
 {
     SetFuelAmount(controller.GetThrusterFuelAmount());
     SetHealthAmount(player.GetHealthPct());
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         TogglePauseMenu();
     }
 }
Beispiel #5
0
 void Update()
 {
     SetFuelAmount(controller.GetThrusterFuelAmount());
     SetHealthAmount(player.GetHealthPct());
     if (weaponManager != null && weaponManager.GetCurrentWeapon() != null)
     {
         SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets);
     }
 }
Beispiel #6
0
    void Update()
    {
        SetHealthAmount(player.GetHealthPct());
        SetFuelAmount(controller.GetThrusterFuelAmount());
        SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets);

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            TogglePauseMenu();
        }
    }
Beispiel #7
0
    void Update()
    {
        SetHealthAmount(player.GetHealthPct());

        // Debug.Log(player.GetHealthPct());

        SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets);

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            TogglePauseMenu();
        }
    }
Beispiel #8
0
    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);
        }
    }
Beispiel #10
0
    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);
        }
    }
Beispiel #11
0
    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");
        }
    }
Beispiel #12
0
 void Update()
 {
     SetHealthAmount(player.GetHealthPct());
 }
Beispiel #13
0
 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);
 }
Beispiel #17
0
 void Update()
 {
     SetFuelAmount(controller.GetThrusterFuelAmount());
     SetHealthAmount(player.GetHealthPct());
 }