Exemplo n.º 1
0
 public void RegisterSoundHeard(SoundHeard sound)
 {
     if (sound.Loudness > 5 && active)
     {
         OnSoundHeard?.Invoke();
     }
 }
Exemplo n.º 2
0
        private void SaveAnswer()
        {
            Sound      currentSound = AvailableSounds[index];
            SoundHeard soundHeard   = new SoundHeard();

            soundHeard.Sound  = currentSound;
            soundHeard.Answer = (int)answerSlider.Value;

            myCurrentMeasurement.Sounds.Add(soundHeard);
        }
Exemplo n.º 3
0
 public void CheckIfInterestRanOutOnSound()
 {
     if (LastSoundHeard != null)
     {
         if ((Time.timeSinceLevelLoad - LastSoundHeard.TimeStamp) > SoundInterestLength)
         {
             LastSoundHeard = null;
         }
     }
 }
Exemplo n.º 4
0
 public void RegisterSoundHeard(SoundHeard sound)
 {
     if (Storage.Energy >= minEnergyToPlaySound)
     {
         if (sound.Loudness >= repetitionMinimum && Time.timeSinceLevelLoad - cooldownTimestamp > cooldownTime)
         {
             PlaySound();
         }
     }
 }
Exemplo n.º 5
0
        public void RegisterSoundHeard(SoundHeard sound)
        {
            if (Energy + Base.Storage.Energy == 0)
            {
                return;
            }

            if (sound.Loudness < 5)
            {
                return;
            }

            if (Time.timeSinceLevelLoad - hearingTimeStamp < HearingCoolDown)
            {
                return;
            }

            hearingTimeStamp = Time.timeSinceLevelLoad;


            if (LastSoundHeard == null)
            {
                LastSoundHeard = sound;
            }
            else
            {
                //UnityEngine.Debug.Log("S1: " + LastSoundHeard.Intesity + " at " + LastSoundHeard.TimeStamp + " = " + (float)LastSoundHeard);
                //UnityEngine.Debug.Log("S2: " + sound.Intesity + " at " + sound.TimeStamp + " = " + (float)sound);
                //UnityEngine.Debug.Log("Is S1 smaller the S2? = " + (LastSoundHeard < sound));

                if (LastSoundHeard < sound)
                {
                    LastSoundHeard = sound;
                }
            }
        }