Hero.setLife C# (CSharp) Method

setLife() public method

public setLife ( float life ) : void
life float
return void
	public void setLife(float life) {
    _lifeManager.setLife(life);
  }
    

Usage Example

    // Use this for initialization
    void Start()
    {
        //TODO trigger this after resize
        hero = GameObject.Find ("Hero").GetComponent<Hero>();
        GameObject lifeIndicator = GameObject.Find ("LifeIndicator");
        Transform progressBar = lifeIndicator.transform.Find("ProgressBar");
        _foreground = progressBar.transform.Find("Foreground");
        _initialScale = _foreground.localScale;

        hero.setLife(startLife);
    }
All Usage Examples Of Hero::setLife