Пример #1
0
 public void RegisterSoundHeard(SoundHeard sound)
 {
     if (sound.Loudness > 5 && active)
     {
         OnSoundHeard?.Invoke();
     }
 }
Пример #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);
        }
Пример #3
0
 public void CheckIfInterestRanOutOnSound()
 {
     if (LastSoundHeard != null)
     {
         if ((Time.timeSinceLevelLoad - LastSoundHeard.TimeStamp) > SoundInterestLength)
         {
             LastSoundHeard = null;
         }
     }
 }
Пример #4
0
 public void RegisterSoundHeard(SoundHeard sound)
 {
     if (Storage.Energy >= minEnergyToPlaySound)
     {
         if (sound.Loudness >= repetitionMinimum && Time.timeSinceLevelLoad - cooldownTimestamp > cooldownTime)
         {
             PlaySound();
         }
     }
 }
Пример #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;
                }
            }
        }