コード例 #1
0
 void Death()
 {
     if (death)
     {
         Common_AudioManager.PlaySound(death, transform.position);
     }
 }
コード例 #2
0
 void Sleeping()
 {
     if (sleeping)
     {
         Common_AudioManager.PlaySound(sleeping, transform.position);
     }
 }
コード例 #3
0
 void Attacking()
 {
     if (attacking)
     {
         Common_AudioManager.PlaySound(attacking, transform.position);
     }
 }
コード例 #4
0
 void Running()
 {
     if (running)
     {
         Common_AudioManager.PlaySound(running, transform.position);
     }
 }
コード例 #5
0
 void Eating()
 {
     if (eating)
     {
         Common_AudioManager.PlaySound(eating, transform.position);
     }
 }
コード例 #6
0
 void Walking()
 {
     if (walking)
     {
         Common_AudioManager.PlaySound(walking, transform.position);
     }
 }
コード例 #7
0
 void AnimalSound()
 {
     if (animalSound)
     {
         Common_AudioManager.PlaySound(animalSound, transform.position);
     }
 }
コード例 #8
0
        private void Awake()
        {
            instance = this;

            for (int i = 0; i < objectPoolLength; i++)
            {
                GameObject soundObject = new GameObject();
                soundObject.transform.SetParent(instance.transform);
                soundObject.name = "Sound Effect";
                AudioSource audioSource = soundObject.AddComponent <AudioSource>();
                audioSource.spatialBlend = 1f;
                audioSource.minDistance  = instance.soundDistance;
                audioSource.gameObject.SetActive(false);
                pool.Add(audioSource);
            }
        }