private void Awake() { _lineRenderer = GetComponent <LineRenderer>(); //The hurtbox of this object isn't used normally (with collision) but is applied by the laser programmatically _hurtbox = GetComponent <Hurtbox>(); _laserAudio = Commons.AudioManager.GetComponent <LaserAudio>(); }
private void ShowFiringEffects() { LaserEffects.SetActive(true); LaserChargeBeam.SetActive(false); //SmokeAndSparks.SetActive(true); //LaserSparks.Play(); //LaserSmoke.Play(); LaserAudio.Play(); colliderBox.enabled = true; }
private void StopEffects() { LaserEffects.SetActive(false); LaserChargeBeam.SetActive(false); //LaserSparks.Stop(); //LaserSmoke.Stop(); LaserAudio.Stop(); LaserStopAudio.Play(); hasPlayedChargingEffects = false; colliderBox.enabled = false; }
private void InitializeLaser() { // Init effects. LaserEffects.SetActive(false); LaserChargeBeam.SetActive(false); //SmokeAndSparks.SetActive(false); LaserChargeAudio.Stop(); LaserAudio.Stop(); LaserStopAudio.Stop(); // Init collider. colliderBox = this.GetComponent <BoxCollider>(); colliderBox.enabled = false; // Init laser length vector. laserLength = new Transform[7]; }