void Awake() { character = GetComponent <SCR_character>(); attackReady = true; attackBufferAllowed = true; dir = new GameObject("rangedDir"); Transform dirTrans = dir.transform; dirTrans.parent = transform; dir.transform.localPosition = Vector3.zero; SND_shot = SCR_main.SetupSoundArray(transform, shotSound, true, true); }
public void StartUp(bool isPlayer) { character = GetComponent <SCR_character>(); attackReady = true; attackBufferAllowed = true; attackRange *= transform.localScale.x; if (isPlayer) { targetStr = "Enemy"; } else { targetStr = "Player"; } SND_attack = SCR_main.SetupSoundArray(transform, attackSound, true, true); SND_attackHit = SCR_main.SetupSoundArray(transform, attackHitSound, true, true); }
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(bool isPlayer, int _damage) { damage = _damage; SND_impact = SCR_main.SetupSoundArray(transform, impactSound, true, true); if (GetComponent <SCR_projectileTrail> ()) { trail = GetComponent <SCR_projectileTrail> (); } mesh = transform.Find(meshStr).GetComponent <Renderer> (); mesh.material.mainTexture = projectileTex; if (isPlayer) { targetStr = "Enemy"; } else { targetStr = "Player"; } }