Beispiel #1
0
 protected override void OnDeath()
 {
     if (explosionSounds.Length > 0)
     {
         int soundIndex = Random.Range(0, explosionSounds.Length);
         AudioSourceManager.PlayOneShot(this.transform, explosionSounds[soundIndex], explosionVol);
     }
     else
     {
         Debug.Log("<Color=Red><b>Missing</b></Color> explosionSounds on EnemyHealth script on many Enemy GameObjects");
     }
     if (scoreKeeper)
     {
         scoreKeeper.Killed(gameObject);
     }
     else
     {
         Debug.Log("ScoreKeeper missing from EnemyHealth", gameObject);
     }
     base.OnDeath();
     if (PhotonNetwork.IsMasterClient)
     {
         PhotonNetwork.Destroy(gameObject);
     }
 }
    public void NoteOn(NoteMessage message)
    {
        audioPool.PlayOneShot(GetClip(message.pitch), volume);

        /*
         * var source = audioPool.PlaySound(GetClip(message.pitch));
         * if(playingSource.ContainsKey(message.pitch))
         * {
         *      playingSource[message.pitch] = source;
         * }
         * else
         * {
         *      playingSource.Add(message.pitch,source);
         * }*/
    }