private void HandleStepStateChanged(Step step, TimelineState state) { // If playing, check if we're done. if (!RegisteredSteps.Any(s => s.IsBusy)) { State = TimelineState.Stopped; RecordingLord.StopRecording(); Camera.main.orthographic = false; if (HaxxisGlobalSettings.Instance.IsVgsJob == true) { if (TimelineViewBehaviour.Instance.NumRecordingsStartedThisPlayback == 0) { HaxxisGlobalSettings.Instance.ReportVgsError(6, "Choreography had no recording step"); } } if (HaxxisGlobalSettings.Instance.IsVgsJob == true) { HaxxisGlobalSettings.Instance.ReportVgsVideoDuration(); } } // Check for seek arrival if (IsSeeking) { if (step == SeekTarget) { // Hmm I thought something like this was going to be needed...? //if ( state == TimelineState.Playing ) IsSeeking = false; if (SeekThrough) { SetNormalSpeed(); } else { Pause(); } } } }
// Call only from Steps! public void RegisterStep(Step step) { step.StateChanged += HandleStepStateChanged; step.SeekToRequested += HandleStepSeekToRequested; step.SeekThroughRequested += HandleStepSeekThroughRequested; if (!step.IsJustMovingNotBeingDeleted) { var boundsProvider = step as IBoundsProvider; if (boundsProvider != null) { BoundsProviderRepository.Add(boundsProvider); } } RegisteredSteps.Add(step); }
// Call only from Steps! public void UnregisterStep(Step step) { step.StateChanged -= HandleStepStateChanged; step.SeekToRequested -= HandleStepSeekToRequested; step.SeekThroughRequested -= HandleStepSeekThroughRequested; RegisteredSteps.Remove(step); if (!step.IsJustMovingNotBeingDeleted) { var boundsProvider = step as IBoundsProvider; if (boundsProvider != null) { BoundsProviderRepository.Remove(boundsProvider); } } step.CleanUp(); StepUnregistered(step); }