Example #1
0
 void Start()
 {
     startingLife = player.GetComponent <PlayerStats>().getMaxHealth();                // Accesam viata maxima a player-ului din scriptul PlayerStats
     currentLife  = startingLife;                                                      // Egalam viata curenta cu cea maxima pentru inceput
     healthBar.SetMaxHealth(startingLife);                                             // Setam bara de UI Health sa fie plina (cat viata maxima)
     healthNumberText.text = currentLife.ToString() + " / " + startingLife.ToString(); // Afisam in bara si viata in text pentru o claritate mai buna
     startingShield        = 100;
     currentShield         = startingShield;
     shieldBar.SetMaxShield(startingShield);
     shieldNumberText.text = currentShield.ToString() + "/" + startingShield.ToString();
 }
Example #2
0
    public void EngageShield()
    {
        playerShield = player.GetComponent <PlayerHealth>().GetShield();
        shieldBar.SetMaxShield(100);
        player.GetComponent <PlayerHealth>().SetCurrentShield(100);
        shieldBar.gameObject.SetActive(true);

        areShieldsUp = true;
    }
Example #3
0
 public void ShieldPowerUp()
 {
     if (Input.GetKeyDown(KeyCode.C) && shieldStack > 0)
     {
         currentShield = maxShield;
         shieldBar.SetMaxShield(maxShield);
         go = Instantiate(shieldPrefab, transform.position, transform.rotation);
         go.transform.parent = this.transform;
         shieldStack        -= 1;
     }
 }
Example #4
0
 void Start()
 {
     currentXP = 0;
     XPBar.SetMaxXP(MaxXP);
     currentStamina = MaxStamina;
     staminaBar.SetMaxStamina(MaxStamina);
     currentHealth = maxHealth;
     healthBar.SetMaxhealth(maxHealth);
     currentShield = MaxShield;
     shieldbar.SetMaxShield(MaxShield);
     gold = 0;
 }
Example #5
0
    void Start()
    {
        r = this.GetComponent <Rigidbody2D>();
        shield.SetActive(false);
        maxShield     = 80;
        currentShield = maxShield;
        health.SetMaxHealth(100);
        typeWeapon.Add("Normal");
        healthBar.SetMaxHealth(health.GetMaxHealth());
        sh.SetMaxShield(maxShield);

        projectile.GetComponent <Projectile>().changeColor(0);
    }
Example #6
0
 // Start is called before the first frame update
 void Start()
 {
     // Cursor.lockState = CursorLockMode.Locked;
     StartGameAud.Play();
     Round  = 1;
     Kills  = 0;
     Health = MaxHealth;
     healthBar.SetMaxHealth(Health);
     ShieldBar.SetMaxShield(MaxShield);
     //Shield -= 100;
     ShieldBar.SetShield(Shield);
     Damage  = 20;
     OnSword = BladeofLight;
     BladeofLight.SetActive(true);
     //OnSword = Sword.Find("SwordStarter");
 }