public void Start() { myCanvas = gameObject.transform.Find("Canvas").GetComponent <Canvas>(); myPlayer = GameObject.Find("Player"); myHealthState = gameObject.GetComponent <HealthState> (); healthBar.Init("", myHealthState.initialHealthPoints); }
void Start() { GameObject goPlayer = GameObject.FindWithTag("Player"); myPlayerState = goPlayer.GetComponent <PlayerState> (); myPlayerShoot = goPlayer.GetComponent <PlayerShoot> (); healthBar.Init("Life: %", myPlayerState.initialHealthPoints); staminaBar.Init("Stamina: %", myPlayerState.GetStaminaState().initialStaminaPoints); }