void SetGlobalPause() { Native.SetBeatTime(globalBeatTime); Native.Pause(pause_); lastSampledTime = AudioSettings.dspTime; globalPause = pause_; }
public void StartScheduled(double timeToStart) { lastSampledTime = AudioSettings.dspTime; double deltaTime = timeToStart - lastSampledTime; globalBeatTime = -deltaTime * globalBpm / SECONDS_PER_MIN; Native.SetBeatTime(globalBeatTime); }
void FixedUpdate() { double time = AudioSettings.dspTime; double deltaTime = time - lastSampledTime; lastSampledTime = time; globalBeatTime += deltaTime * globalBpm / SECONDS_PER_MIN; Native.SetBeatTime(globalBeatTime); }
/// <summary> /// Resets time and all sequencers from the beginning. /// </summary> public void Reset() { globalBeatTime = -waitToSync; Native.SetBeatTime(globalBeatTime); lastSampledTime = AudioSettings.dspTime; if (OnReset != null) { OnReset(); } }