/// <summary> /// Initialize the shot track by enabling the first Camera and disabling all others in the track. /// </summary> public override void Initialize() { base.elapsedTime = 0f; CinemaShot firstCamera = null; foreach (CinemaShot shot in GetTimelineItems()) { shot.Initialize(); } foreach (CinemaShot shot in GetTimelineItems()) { if (shot.Firetime == 0) { firstCamera = shot; } else { shot.End(); } } if (firstCamera != null) { firstCamera.Trigger(); if (ShotBegins != null) { ShotBegins(this, new ShotEventArgs(firstCamera)); } } }
/// <summary> /// The shot track will jump to the given time. Disabling the current shot and enabling the new one. /// </summary> /// <param name="time">The new running time.</param> public override void SetTime(float time) { #if PROFILE_FILE Profiler.BeginSample("ShotTrack.SetTime"); #endif // PROFILE_FILE CinemaShot previousShot = null; CinemaShot newShot = null; // Get the old shot and the new shot var list = this.GetTimelineItems(); var length = list.Length; for (var i = 0; i < length; i++) { var shot = list[i] as CinemaShot; float endTime = shot.CutTime + shot.Duration; if ((elapsedTime >= shot.CutTime) && (elapsedTime < endTime)) { previousShot = shot; } if ((time >= shot.CutTime) && (time < endTime)) { newShot = shot; } } // Trigger them as appropriate. if (newShot != previousShot) { if (previousShot != null) { previousShot.End(); if (ShotEnds != null) { ShotEnds(this, new ShotEventArgs(previousShot)); } } if (newShot != null) { newShot.Trigger(); if (ShotBegins != null) { ShotBegins(this, new ShotEventArgs(newShot)); } } } elapsedTime = time; #if PROFILE_FILE Profiler.EndSample(); #endif // PROFILE_FILE }
/// <summary> /// The shot track will jump to the given time. Disabling the current shot and enabling the new one. /// </summary> /// <param name="time">The new running time.</param> public override void SetTime(float time) { CinemaShot previousShot = null; CinemaShot newShot = null; { var __array4 = GetTimelineItems(); var __arrayLength4 = __array4.Length; for (int __i4 = 0; __i4 < __arrayLength4; ++__i4) { var shot = (CinemaShot)__array4[__i4]; { float endTime = shot.CutTime + shot.Duration; if ((elapsedTime >= shot.CutTime) && (elapsedTime < endTime)) { previousShot = shot; } if ((time >= shot.CutTime) && (time < endTime)) { newShot = shot; } } } } // Trigger them as appropriate. if (newShot != previousShot) { if (previousShot != null) { previousShot.End(); if (ShotEnds != null) { ShotEnds(this, new ShotEventArgs(previousShot)); } } if (newShot != null) { newShot.Trigger(); if (ShotBegins != null) { ShotBegins(this, new ShotEventArgs(newShot)); } } } elapsedTime = time; }
/// <summary> /// Initialize the shot track by enabling the first Camera and disabling all others in the track. /// </summary> public override void Initialize() { base.elapsedTime = 0f; CinemaShot firstCamera = null; { var __array1 = GetTimelineItems(); var __arrayLength1 = __array1.Length; for (int __i1 = 0; __i1 < __arrayLength1; ++__i1) { var shot = (CinemaShot)__array1[__i1]; { shot.Initialize(); } } } { var __array2 = GetTimelineItems(); var __arrayLength2 = __array2.Length; for (int __i2 = 0; __i2 < __arrayLength2; ++__i2) { var shot = (CinemaShot)__array2[__i2]; { if (shot.Firetime == 0) { firstCamera = shot; } else { shot.End(); } } } } if (firstCamera != null) { firstCamera.Trigger(); if (ShotBegins != null) { ShotBegins(this, new ShotEventArgs(firstCamera)); } } }
/// <summary> /// Initialize the shot track by enabling the first Camera and disabling all others in the track. /// </summary> public override void Initialize() { #if PROFILE_FILE Profiler.BeginSample("ShotTrack.Initialize"); #endif // PROFILE_FILE base.elapsedTime = 0f; CinemaShot firstCamera = null; var list = this.GetTimelineItems(); var length = list.Length; for (var i = 0; i < length; i++) { var shot = list[i] as CinemaShot; shot.Initialize(); } for (var i = 0; i < length; i++) { var shot = list[i] as CinemaShot; if (shot.Firetime == 0) { firstCamera = shot; } else { shot.End(); } } if (firstCamera != null) { firstCamera.Trigger(); if (ShotBegins != null) { ShotBegins(this, new ShotEventArgs(firstCamera)); } } #if PROFILE_FILE Profiler.EndSample(); #endif // PROFILE_FILE }
/// <summary> /// The shot track will jump to the given time. Disabling the current shot and enabling the new one. /// </summary> /// <param name="time">The new running time.</param> public override void SetTime(float time) { CinemaShot previousShot = null; CinemaShot newShot = null; // Get the old shot and the new shot foreach (CinemaShot shot in GetTimelineItems()) { float endTime = shot.CutTime + shot.Duration; if ((elapsedTime >= shot.CutTime) && (elapsedTime < endTime)) { previousShot = shot; } if ((time >= shot.CutTime) && (time < endTime)) { newShot = shot; } } // Trigger them as appropriate. if (newShot != previousShot) { if (previousShot != null) { previousShot.End(); if (ShotEnds != null) { ShotEnds(this, new ShotEventArgs(previousShot)); } } if (newShot != null) { newShot.Trigger(); if (ShotBegins != null) { ShotBegins(this, new ShotEventArgs(newShot)); } } } elapsedTime = time; }
public ShotEventArgs(CinemaShot shot) { this.shot = shot; }