Beispiel #1
0
        /// <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;

            CinemaGlobalAction firstCamera = null;

            TimelineItem[] items = GetTimelineItems();
            for (int i = 0; i < items.Length; i++)
            {
                CinemaGlobalAction shot = items[i] as CinemaGlobalAction;
                shot.Initialize();
            }

            for (int i = 0; i < items.Length; i++)
            {
                CinemaGlobalAction shot = items[i] as CinemaGlobalAction;
                if (shot.Firetime == 0)
                {
                    firstCamera = shot;
                }
                else
                {
                    shot.End();
                }
            }

            if (firstCamera != null)
            {
                firstCamera.Trigger();
                if (ShotBegins != null)
                {
                    ShotBegins(this, new ShotEventArgs(firstCamera));
                }
            }
        }