Пример #1
0
        /// <summary>
        /// The cutscene has been set to an arbitrary time by the user.
        /// Processing must take place to catch up to the new time.
        /// </summary>
        /// <param name="time">The new cutscene running time</param>
        public virtual void SetTime(float time)
        {
            float previousTime = elapsedTime;

            elapsedTime = time;

            foreach (TimelineItem item in GetTimelineItems())
            {
                // Check if it is a global event.
                CinemaGlobalEvent cinemaEvent = item as CinemaGlobalEvent;
                if (cinemaEvent != null)
                {
                    if ((previousTime < cinemaEvent.Firetime) && (((elapsedTime >= cinemaEvent.Firetime))))
                    {
                        cinemaEvent.Trigger();
                    }
                    else if (((previousTime >= cinemaEvent.Firetime) && (elapsedTime < cinemaEvent.Firetime)))
                    {
                        cinemaEvent.Reverse();
                    }
                }

                // Check if it is a global action.
                CinemaGlobalAction action = item as CinemaGlobalAction;
                if (action != null)
                {
                    action.SetTime((time - action.Firetime), time - previousTime);
                }
            }
        }
        /// <summary>
        /// The cutscene has been set to an arbitrary time by the user.
        /// Processing must take place to catch up to the new time.
        /// </summary>
        /// <param name="time">The new cutscene running time</param>
        public virtual void SetTime(float time)
        {
            float previousTime = elapsedTime;

            elapsedTime = time;

            TimelineItem[] items = GetTimelineItems();
            for (int i = 0; i < items.Length; i++)
            {
                // Check if it is a global event.
                CinemaGlobalEvent cinemaEvent = items[i] as CinemaGlobalEvent;
                if (cinemaEvent != null)
                {
                    if ((previousTime < cinemaEvent.Firetime && time >= cinemaEvent.Firetime) || (cinemaEvent.Firetime == 0f && previousTime <= cinemaEvent.Firetime && time > cinemaEvent.Firetime))
                    {
                        cinemaEvent.Trigger();
                    }
                    else if (previousTime > cinemaEvent.Firetime && elapsedTime <= cinemaEvent.Firetime)
                    {
                        cinemaEvent.Reverse();
                    }
                }

                // Check if it is a global action.
                CinemaGlobalAction action = items[i] as CinemaGlobalAction;
                if (action != null)
                {
                    action.SetTime((time - action.Firetime), time - previousTime);
                }
            }
        }
Пример #3
0
        /// <summary>
        /// The cutscene has been set to an arbitrary time by the user.
        /// Processing must take place to catch up to the new time.
        /// </summary>
        /// <param name="time">The new cutscene running time</param>
        public virtual void SetTime(float time)
        {
            float previousTime = elapsedTime;

            elapsedTime = time;

            TimelineItem[] timelineItemArr = GetTimelineItems();
            for (int i = 0; i < timelineItemArr.Length; i++)
            {
                TimelineItem item = timelineItemArr[i];
                // Check if it is a global event.
                CinemaGlobalEvent cinemaEvent = item as CinemaGlobalEvent;
                if (cinemaEvent != null)
                {
                    if ((previousTime < cinemaEvent.Firetime) && (((elapsedTime >= cinemaEvent.Firetime))))
                    {
                        cinemaEvent.Trigger();
                    }
                    else if (((previousTime >= cinemaEvent.Firetime) && (elapsedTime < cinemaEvent.Firetime)))
                    {
                        cinemaEvent.Reverse();
                    }
                }

                // Check if it is a global action.
                CinemaGlobalAction action = item as CinemaGlobalAction;
                if (action != null)
                {
                    action.SetTime((time - action.Firetime), time - previousTime);
                }
            }
        }
 static public int SetTime(IntPtr l)
 {
     try {
         CinemaDirector.CinemaGlobalAction self = (CinemaDirector.CinemaGlobalAction)checkSelf(l);
         System.Single a1;
         checkType(l, 2, out a1);
         System.Single a2;
         checkType(l, 3, out a2);
         self.SetTime(a1, a2);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Пример #5
0
        /// <summary>
        /// The cutscene has been set to an arbitrary time by the user.
        /// Processing must take place to catch up to the new time.
        /// </summary>
        /// <param name="time">The new cutscene running time</param>
        public virtual void SetTime(float time)
        {
#if PROFILE_FILE
            Profiler.BeginSample("TimelineTrack.SetTime");
#endif // PROFILE_FILE
            float previousTime = elapsedTime;
            elapsedTime = time;

            var timeLines = GetTimelineItems();
            var length    = timeLines.Length;
            for (var i = 0; i < length; i++)
            {
                var item = timeLines[i];
                // Check if it is a global event.
                CinemaGlobalEvent cinemaEvent = item as CinemaGlobalEvent;
                if (cinemaEvent != null)
                {
                    if ((previousTime < cinemaEvent.Firetime) && (((elapsedTime >= cinemaEvent.Firetime))))
                    {
                        cinemaEvent.Trigger();
                    }
                    else if (((previousTime >= cinemaEvent.Firetime) && (elapsedTime < cinemaEvent.Firetime)))
                    {
                        cinemaEvent.Reverse();
                    }
                }

                // Check if it is a global action.
                CinemaGlobalAction action = item as CinemaGlobalAction;
                if (action != null)
                {
                    action.SetTime((time - action.Firetime), time - previousTime);
                }
            }
#if PROFILE_FILE
            Profiler.EndSample();
#endif // PROFILE_FILE
        }
Пример #6
0
        /// <summary>
        /// The cutscene has been set to an arbitrary time by the user.
        /// Processing must take place to catch up to the new time.
        /// </summary>
        /// <param name="time">The new cutscene running time</param>
        public virtual void SetTime(float time)
        {
            float previousTime = elapsedTime;

            elapsedTime = time;
            {
                var __array5       = GetTimelineItems();
                var __arrayLength5 = __array5.Length;
                for (int __i5 = 0; __i5 < __arrayLength5; ++__i5)
                {
                    var item = (TimelineItem)__array5[__i5];
                    {
                        // Check if it is a global event.
                        CinemaGlobalEvent cinemaEvent = item as CinemaGlobalEvent;
                        if (cinemaEvent != null)
                        {
                            if ((previousTime < cinemaEvent.Firetime) && (((elapsedTime >= cinemaEvent.Firetime))))
                            {
                                cinemaEvent.Trigger();
                            }
                            else if (((previousTime >= cinemaEvent.Firetime) && (elapsedTime < cinemaEvent.Firetime)))
                            {
                                cinemaEvent.Reverse();
                            }
                        }

                        // Check if it is a global action.
                        CinemaGlobalAction action = item as CinemaGlobalAction;
                        if (action != null)
                        {
                            action.SetTime((time - action.Firetime), time - previousTime);
                        }
                    }
                }
            }
        }