Ejemplo n.º 1
0
 public void SubscribeToDart(IDart leDart, DartGunV2 dartGun)
 {
     _dart = leDart;
     _dartGun = dartGun;
     leDart.DartDestroyed += LeDartOnDartDestroyed;
     leDart.DartCollision += LeDart_DartCollision;
 }
Ejemplo n.º 2
0
 public void SubscribeToDart(IDart leDart, DartGunV2 dartGun)
 {
     _dart                 = leDart;
     _dartGun              = dartGun;
     leDart.DartDestroyed += LeDartOnDartDestroyed;
     leDart.DartCollision += LeDart_DartCollision;
 }
Ejemplo n.º 3
0
    private void OnDartFired(object sender, DartFiredEventArgs dartFiredEventArgs)
    {
        _currentDartShot                = dartFiredEventArgs.Dart;
        _currentDartShot.JuiceSucked   += DartOnJuiceSucked;
        _currentDartShot.DartDestroyed += DartOnDartDestroyed;
//        Debug.Log("OnDartFired");
        m_FireSound = SoundManager.PlaySFX(Fire);
    }
Ejemplo n.º 4
0
    protected override void FireDart()
    {
        var leDart =
            (DartV2) Instantiate(_dartPrefab, _dartSpawnPoint.transform.position, _dartSpawnPoint.transform.rotation);
        leDart.PushConfig(Settings, _inputManager, _delayManager);
        leDart.ShootBullet(Settings.DartForce, _dartSpawnPoint.transform);
        OnDartFired(new DartFiredEventArgs { Dart = leDart });

        _spawningHoseCoroutine = StartCoroutine(SpawnHosePortions(this, leDart));
        _currentDart = leDart;
        leDart.DartDestroyed += LeDart_DartDestroyed;
        SoundManager.PlaySFX(Fire);
        InstatiateParticle(m_firingParticle, ParticlesSpawningPoint, true);
    }
Ejemplo n.º 5
0
 private void DartOnDartDestroyed(object sender, EventArgs eventArgs)
 {
     _currentDartShot = null;
     _delayManager.SetDelay(0);
     _delayManager.AddDelay(Settings._shootDelay);
     CoolDownEffects();
     if (m_SappingAudioSource != null && m_SappingAudioSource.isPlaying)
     {
         m_SappingAudioSource.Stop();
     }
     if (m_FireSound.isPlaying)
     {
         m_FireSound.Stop();
     }
     SoundManager.PlaySFX(WireSnapping);
 }
Ejemplo n.º 6
0
    protected override void FireDart()
    {
        var leDart =
            (DartV2)Instantiate(_dartPrefab, _dartSpawnPoint.transform.position, _dartSpawnPoint.transform.rotation);

        leDart.PushConfig(Settings, _inputManager, _delayManager);
        leDart.ShootBullet(Settings.DartForce, _dartSpawnPoint.transform);
        OnDartFired(new DartFiredEventArgs {
            Dart = leDart
        });

        _spawningHoseCoroutine = StartCoroutine(SpawnHosePortions(this, leDart));
        _currentDart           = leDart;
        leDart.DartDestroyed  += LeDart_DartDestroyed;
        SoundManager.PlaySFX(Fire);
        InstatiateParticle(m_firingParticle, ParticlesSpawningPoint, true);
    }
Ejemplo n.º 7
0
 private void OnDartFired(object sender, DartFiredEventArgs dartFiredEventArgs)
 {
     _currentDartShot = dartFiredEventArgs.Dart;
     _currentDartShot.JuiceSucked += DartOnJuiceSucked;
     _currentDartShot.DartDestroyed += DartOnDartDestroyed;
     //        Debug.Log("OnDartFired");
     m_FireSound = SoundManager.PlaySFX(Fire);
 }
Ejemplo n.º 8
0
 private void DartOnDartDestroyed(object sender, EventArgs eventArgs)
 {
     _currentDartShot = null;
     _delayManager.SetDelay(0);
     _delayManager.AddDelay(Settings._shootDelay);
     CoolDownEffects();
     if (m_SappingAudioSource != null && m_SappingAudioSource.isPlaying)
     {
         m_SappingAudioSource.Stop();
     }
     if (m_FireSound.isPlaying) m_FireSound.Stop();
     SoundManager.PlaySFX(WireSnapping);
 }
Ejemplo n.º 9
0
 private void HandleHpScript(HPScript hpScript)
 {
     _collidedWithSmth = true;
     var shield = hpScript.gameObject.GetComponent<shield>();
     if (shield != null && shield.IsShieldActive)
     {
         StickTo(shield.gameObject);
         SoundManager.PlaySFX(Severed);
     }
     else
     {
         _collidedWithSmth = true;
         _target = hpScript;
         StickTo(hpScript.gameObject);
         _suckHpCoroutine = StartCoroutine(SuckHpFrom(hpScript));
         _hpScriptToUnsubscribe = hpScript;
         _dartToUnsubscribe = this;
         hpScript.Dead += HpScript_Dead;
         DartDestroyed += HpScript_Dead;
         SoundManager.PlaySFX(PlayerImpact);
     }
     OnDartCollision();
 }