public void RegisterSoundHeard(SoundHeard sound) { if (sound.Loudness > 5 && active) { OnSoundHeard?.Invoke(); } }
private void SaveAnswer() { Sound currentSound = AvailableSounds[index]; SoundHeard soundHeard = new SoundHeard(); soundHeard.Sound = currentSound; soundHeard.Answer = (int)answerSlider.Value; myCurrentMeasurement.Sounds.Add(soundHeard); }
public void CheckIfInterestRanOutOnSound() { if (LastSoundHeard != null) { if ((Time.timeSinceLevelLoad - LastSoundHeard.TimeStamp) > SoundInterestLength) { LastSoundHeard = null; } } }
public void RegisterSoundHeard(SoundHeard sound) { if (Storage.Energy >= minEnergyToPlaySound) { if (sound.Loudness >= repetitionMinimum && Time.timeSinceLevelLoad - cooldownTimestamp > cooldownTime) { PlaySound(); } } }
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; } } }