Esempio n. 1
0
 // Start is called before the first frame update
 void Start()
 {
     propBoxCollider = GetComponent <BoxCollider2D>();
     rb2D            = GetComponent <Rigidbody2D>();
     currentHealth   = maxHealth;         //meter code
     healthMeter.SetMaxHealth(maxHealth); //meter code
 }
Esempio n. 2
0
    public int maxHealth = 80;      //defines the maximum value of your variable (keep it at a multiple of 8 so that it matches the meter's sections)


    void Start()
    {
        currentHealth = maxHealth;           //sets your variable to maximum from the start
        healthMeter.SetMaxHealth(maxHealth); //sets your meter's fill to maximum from the start
    }