void minionOuchEventHandler(Vector3 pos)
    {
        if (punchAudio)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, pos, Quaternion.identity, null);

            snd.audioSrc.clip = this.punchAudio;

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 100f;

            snd.audioSrc.Play();
        }


        if (minionOuchAudio)
        {
            EventSound3D snd2 = Instantiate(eventSound3DPrefab, pos, Quaternion.identity, null);

            snd2.audioSrc.clip = this.minionOuchAudio;

            snd2.audioSrc.minDistance = 5f;
            snd2.audioSrc.maxDistance = 100f;

            snd2.audioSrc.Play();
        }
    }
    void minionLandsEventHandler(Vector3 worldPos, float collisionMagnitude)
    {
        //AudioSource.PlayClipAtPoint(this.explosionAudio, worldPos, 1f);

        if (eventSound3DPrefab)
        {
            if (collisionMagnitude > 300f)
            {
                EventSound3D snd = Instantiate(eventSound3DPrefab, worldPos, Quaternion.identity, null);

                snd.audioSrc.clip = this.punchAudio;

                snd.audioSrc.minDistance = 5f;
                snd.audioSrc.maxDistance = 100f;

                snd.audioSrc.Play();

                if (collisionMagnitude > 500f)
                {
                    EventSound3D snd2 = Instantiate(eventSound3DPrefab, worldPos, Quaternion.identity, null);

                    snd2.audioSrc.clip = this.minionOuchAudio;

                    snd2.audioSrc.minDistance = 5f;
                    snd2.audioSrc.maxDistance = 100f;

                    snd2.audioSrc.Play();
                }
            }
        }
    }
 private void detectionEventHandler(Vector3 pos)
 {
     if (eventSound3DPrefab)
     {
         EventSound3D snd = Instantiate(eventSound3DPrefab, pos, Quaternion.identity, null);
         snd.audioSrc.clip = this.playerDetectionAudio;
         snd.audioSrc.Play();
     }
 }
 private void guardSoundEventHandler(Vector3 pos)
 {
     if (spawnAudio)
     {
         EventSound3D snd = Instantiate(eventSound3DPrefab, pos, Quaternion.identity, null);
         snd.audioSrc.clip        = this.guardAudio[0];
         snd.audioSrc.minDistance = 5f;
         snd.audioSrc.maxDistance = 100f;
         snd.audioSrc.Play();
     }
 }
Exemple #5
0
 private void PlaySound(Vector3 worldPos, AudioClip audioClip, float minDistance = 5f, float maxDistance = 100f)
 {
     if (eventSound3DPrefab)
     {
         EventSound3D snd = Instantiate(eventSound3DPrefab, worldPos, Quaternion.identity, null);
         snd.audioSrc.clip        = audioClip;
         snd.audioSrc.minDistance = minDistance;
         snd.audioSrc.maxDistance = maxDistance;
         snd.audioSrc.Play();
     }
 }
 void playerFallingEventHandler(RobotHeroController player)
 {
     if (playerFalling)
     {
         EventSound3D snd = Instantiate(eventSound3DPrefab, player.transform.position, Quaternion.identity, null);
         snd.audioSrc.clip        = this.playerFalling;
         snd.audioSrc.minDistance = 5f;
         snd.audioSrc.maxDistance = 100f;
         snd.audioSrc.Play();
     }
 }
 private void youLoseEventHandler(Vector3 pos)
 {
     if (eventSound3DPrefab)
     {
         EventSound3D snd = Instantiate(eventSound3DPrefab, pos, Quaternion.identity, null);
         snd.audioSrc.clip        = this.youLoseAudio;
         snd.audioSrc.minDistance = 5f;
         snd.audioSrc.maxDistance = 100f;
         snd.audioSrc.loop        = true;
         snd.audioSrc.Play();
     }
 }
 private void gameMenuAudioEventHandler(Vector3 pos)
 {
     if (eventSound3DPrefab)
     {
         EventSound3D snd = Instantiate(eventSound3DPrefab, pos, Quaternion.identity, null);
         snd.audioSrc.clip        = this.gameMenuAudio;
         snd.audioSrc.minDistance = 5f;
         snd.audioSrc.maxDistance = 100f;
         snd.audioSrc.loop        = true; // Let the scene always play music
         snd.audioSrc.Play();
     }
 }
    void sheepSoundEventHandler(Vector3 pos)
    {
        if (sheepAudio)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, pos, Quaternion.identity, null);
            snd.audioSrc.clip = this.sheepAudio;

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 50f;

            snd.audioSrc.Play();
        }
    }
Exemple #10
0
    void robotDeathEventHandler(EnemyController enemy)
    {
        if (enemyRobotDeath)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, enemy.transform.position, Quaternion.identity, null);
            snd.audioSrc.clip = this.enemyRobotDeath;

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 100f;

            snd.audioSrc.Play();
        }
    }
    void portalSpawnSoundEventHandler(Vector3 pos)
    {
        if (portalSpawnAudio)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, pos, Quaternion.identity, null);

            snd.audioSrc.clip = this.portalSpawnAudio;

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 100f;

            snd.audioSrc.Play();
        }
    }
    void minionFootstepEventHandler(Vector3 pos)
    {
        if (minionSpawnAudio)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, pos, Quaternion.identity, null);

            snd.audioSrc.clip = this.minionFootstepAudio[Random.Range(0, minionFootstepAudio.Length)];

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 100f;

            snd.audioSrc.Play();
        }
    }
    void minionSpawnEventHandler(MinionScript minion)
    {
        if (minionSpawnAudio)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, minion.transform.position, Quaternion.identity, null);

            snd.audioSrc.clip = this.minionSpawnAudio;

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 100f;

            snd.audioSrc.Play();
        }
    }
    void minionDeathEventHandler(Vector3 pos, MinionScript ms)
    {
        if (minionDeathAudio)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, pos, Quaternion.identity, null);

            snd.audioSrc.clip = this.minionDeathAudio;

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 100f;

            snd.audioSrc.Play();
        }
    }
Exemple #15
0
    void playerDamageEventHandler(PlayerHealthDamage damage)
    {
        if (playerDamageTaken)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, GameObject.Find("Soldier").transform.position, Quaternion.identity, null);

            snd.audioSrc.clip = this.playerDamageTaken;

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 100f;

            snd.audioSrc.Play();
        }
    }
Exemple #16
0
    void enemyDamageSoundEventHandler(Vector3 worldPos)
    {
        if (eventSound3DPrefab)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, worldPos, Quaternion.identity, null);

            snd.audioSrc.clip = this.enemyDamageAudio;

            snd.audioSrc.minDistance = 50f;
            snd.audioSrc.maxDistance = 500f;

            snd.audioSrc.Play();
        }
    }
Exemple #17
0
    void playerHurtEventHandler(Vector3 worldPos)
    {
        //AudioSource.PlayClipAtPoint(this.explosionAudio, worldPos, 1f);
        if (eventSound3DPrefab)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, worldPos, Quaternion.identity, null);

            snd.audioSrc.clip = this.playerHurtAudio;

            snd.audioSrc.minDistance = 10f;
            snd.audioSrc.maxDistance = 500f;

            snd.audioSrc.Play();
        }
    }
    void playerStepEventHandler(Vector3 worldPos)
    {
        //AudioSource.PlayClipAtPoint(this.explosionAudio, worldPos, 1f);
        //print("playihng crunch");
        if (eventSound3DPrefab)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, worldPos, Quaternion.identity, null);

            snd.audioSrc.clip = this.stepAudio;

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 100f;

            snd.audioSrc.Play();
        }
    }
    void deathEventHandler(GameObject go)
    {
        //AudioSource.PlayClipAtPoint(this.explosionAudio, worldPos, 1f);

        if (eventSound3DPrefab)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, go.transform);

            snd.audioSrc.clip = this.deathAudio;

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 100f;

            snd.audioSrc.Play();
        }
    }
    void boxCollisionEventHandler(Vector3 worldPos, float impactForce)
    {
        //AudioSource.PlayClipAtPoint(this.boxAudio, worldPos);

        const float halfSpeedRange = 0.2f;

        EventSound3D snd = Instantiate(eventSound3DPrefab, worldPos, Quaternion.identity, null);

        snd.audioSrc.clip = this.boxAudio[Random.Range(0, boxAudio.Length)];

        snd.audioSrc.pitch = Random.Range(1f - halfSpeedRange, 1f + halfSpeedRange);

        snd.audioSrc.minDistance = Mathf.Lerp(1f, 8f, impactForce / 200f);
        snd.audioSrc.maxDistance = 100f;

        snd.audioSrc.Play();
    }
    void minionJabberEventHandler(Vector3 worldPos)
    {
        //AudioSource.PlayClipAtPoint(this.explosionAudio, worldPos, 1f);

        if (eventSound3DPrefab)
        {
            EventSound3D snd = Instantiate(eventSound3DPrefab, worldPos, Quaternion.identity, null);

            snd.gameObject.AddComponent <MinionAudioCancelOnDeath>();

            snd.audioSrc.clip = this.minionJabberAudio[Random.Range(0, this.minionJabberAudio.Length)];

            snd.audioSrc.minDistance = 5f;
            snd.audioSrc.maxDistance = 100f;

            snd.audioSrc.Play();
        }
    }