Esempio n. 1
0
 private void Start()
 {
     man        = tempo.GetComponent <TempoManager>();
     tapSound   = SoundUtils.MakeSource(tapSound, gameObject.AddComponent <AudioSource>());
     informer   = TempoStartInformer.GetInstance();
     textShower = GetComponent <FlyingTextShower>();
 }
Esempio n. 2
0
    private void PlayMusic()
    {
        // do calculations and set everything up
        double    bpm  = TempoUtils.FlipBpmInterval(secsPerBeat);
        MusicClip clip = GetClip(bpm);

        currentSong.clip  = clip.clip;
        currentSong.pitch = (float)TempoUtils.GetPitchModifierFromBpm(bpm, clip.bpm);
        currentSong       = SoundUtils.MakeSource(currentSong, GetAudioSource());

        currentSong.source.PlayDelayed((float)(AudioSettings.dspTime - (manager.GetCurrentBeatTime() + secsPerBeat)));
    }