public void StartUp(int id) { health = healthMax; character = GetComponent <SCR_character>(); bool deathSoundRandomPitch = true; if (character.isPlayer) { deathSoundRandomPitch = false; } //death sound SND_death = SCR_main.SetupSoundArray(transform, deathSound, deathSoundRandomPitch, true); GameObject healthBarInst = Instantiate(SCR_main.healthBarObj, Vector3.zero, Quaternion.identity) as GameObject; healthBar = healthBarInst.GetComponent <SCR_healthBar>(); healthBar.StartUp(id); UpdateHealthBar(); }
public void StartUp(int id) { health=healthMax; character=GetComponent<SCR_character>(); bool deathSoundRandomPitch=true; if(character.isPlayer){ deathSoundRandomPitch=false; } //death sound SND_death=SCR_main.SetupSoundArray(transform,deathSound,deathSoundRandomPitch,true); GameObject healthBarInst=Instantiate(SCR_main.healthBarObj,Vector3.zero,Quaternion.identity) as GameObject; healthBar=healthBarInst.GetComponent<SCR_healthBar>(); healthBar.StartUp(id); UpdateHealthBar(); }