Exemple #1
0
    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>();
    }
Exemple #2
0
    private void ShowFiringEffects()
    {
        LaserEffects.SetActive(true);
        LaserChargeBeam.SetActive(false);
        //SmokeAndSparks.SetActive(true);
        //LaserSparks.Play();
        //LaserSmoke.Play();
        LaserAudio.Play();

        colliderBox.enabled = true;
    }
Exemple #3
0
    private void StopEffects()
    {
        LaserEffects.SetActive(false);
        LaserChargeBeam.SetActive(false);
        //LaserSparks.Stop();
        //LaserSmoke.Stop();
        LaserAudio.Stop();
        LaserStopAudio.Play();
        hasPlayedChargingEffects = false;

        colliderBox.enabled = false;
    }
Exemple #4
0
    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];
    }