Ejemplo n.º 1
0
    void FixedUpdate()
    {
        if (running)
        {
            t += Time.fixedDeltaTime;
            if (t > rBPM)
            {
                if (onBeat != null)
                {
                    onBeat();
                }

                melody.DoNote();
                synth.DoNote();
                drums.DoNote();
                t -= rBPM;

                if (BPM != oldBPM)
                {
                    rBPM   = 60f / BPM;
                    oldBPM = BPM;
                }
            }
        }
    }