Exemplo n.º 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 override void SetTime(float time)
        {
            float previousTime = elapsedTime;

            base.SetTime(time);

            //GetActors(ref _actorList);

            IList <TimelineItem> items = GetAllTimelineItems();

            for (int i = 0; i < items.Count; i++)
            {
                // Check if it is an actor event.
                CinemaActorEvent cinemaEvent = items[i] as CinemaActorEvent;
                if (cinemaEvent != null)
                {
                    if ((previousTime < cinemaEvent.Firetime && time >= cinemaEvent.Firetime) || (cinemaEvent.Firetime == 0f && previousTime <= cinemaEvent.Firetime && time > cinemaEvent.Firetime))
                    {
                        for (int j = 0; j < _actorList.Count; j++)
                        {
                            if (_actorList[j] != null)
                            {
                                cinemaEvent.Trigger(_actorList[j].gameObject);
                            }
                        }
                    }
                    else if (previousTime > cinemaEvent.Firetime && time <= cinemaEvent.Firetime)
                    {
                        for (int j = 0; j < _actorList.Count; j++)
                        {
                            if (_actorList[j] != null)
                            {
                                cinemaEvent.Reverse(_actorList[j].gameObject);
                            }
                        }
                    }
                }

                // Check if it is an actor action.
                CinemaActorAction action = items[i] as CinemaActorAction;
                if (action != null)
                {
                    for (int j = 0; j < _actorList.Count; j++)
                    {
                        if (_actorList[j] != null)
                        {
                            action.SetTime(_actorList[j].gameObject, (time - action.Firetime), time - previousTime);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
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 override void SetTime(float time)
        {
            float previousTime = elapsedTime;

            base.SetTime(time);

            foreach (TimelineItem item in GetTimelineItems())
            {
                // Check if it is an actor event.
                CinemaActorEvent cinemaEvent = item as CinemaActorEvent;
                if (cinemaEvent != null)
                {
                    if ((previousTime < cinemaEvent.Firetime) && (((time >= cinemaEvent.Firetime))))
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                cinemaEvent._time = 0;
                                cinemaEvent.Trigger(actor.gameObject);
                            }
                        }
                    }
                    else if (((previousTime >= cinemaEvent.Firetime) && (time < cinemaEvent.Firetime)))
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                cinemaEvent.Reverse(actor.gameObject);
                            }
                        }
                    }
                }

                // Check if it is an actor action.
                CinemaActorAction action = item as CinemaActorAction;
                if (action != null)
                {
                    foreach (Transform actor in Actors)
                    {
                        if (actor != null)
                        {
                            action.SetTime(actor.gameObject, (time - action.Firetime), time - previousTime);
                        }
                    }
                }
            }
        }
Exemplo n.º 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 override void SetTime(float time)
        {
#if PROFILE_FILE
            Profiler.BeginSample("ActorItemTrack.SetTime");
#endif // PROFILE_FILE
            float previousTime = elapsedTime;
            base.SetTime(time);

            var list   = GetTimelineItems();
            var length = list.Length;
            for (var i = 0; i < length; i++)
            {
                var item = list[i];
                // Check if it is an actor event.
                CinemaActorEvent cinemaEvent = item as CinemaActorEvent;
                if (cinemaEvent != null)
                {
                    if (((previousTime < cinemaEvent.Firetime) || (previousTime <= 0f)) && (((time >= cinemaEvent.Firetime))))
                    {
                        var actorList = Actors;
                        var count     = actorList.Count;
                        for (var j = 0; j < count; j++)
                        {
                            var actor = actorList[j];
                            if (actor != null)
                            {
                                cinemaEvent.Trigger(actor.gameObject);
                            }
                        }
                    }
                    else if (((previousTime >= cinemaEvent.Firetime) && (time < cinemaEvent.Firetime)))
                    {
                        var actorList = Actors;
                        var count     = actorList.Count;
                        for (var j = 0; j < count; j++)
                        {
                            var actor = actorList[j];
                            if (actor != null)
                            {
                                cinemaEvent.Reverse(actor.gameObject);
                            }
                        }
                    }
                }

                // Check if it is an actor action.
                CinemaActorAction action = item as CinemaActorAction;
                if (action != null)
                {
                    var actorList = Actors;
                    var count     = actorList.Count;
                    for (var j = 0; j < count; j++)
                    {
                        var actor = actorList[j];
                        if (actor != null)
                        {
                            action.SetTime(actor.gameObject, (time - action.Firetime), time - previousTime);
                        }
                    }
                }
            }
#if PROFILE_FILE
            Profiler.EndSample();
#endif // PROFILE_FILE
        }
Exemplo n.º 4
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 override void SetTime(float time)
        {
            float previousTime = elapsedTime;

            base.SetTime(time);
            {
                var __array2       = GetTimelineItems();
                var __arrayLength2 = __array2.Length;
                for (int __i2 = 0; __i2 < __arrayLength2; ++__i2)
                {
                    var item = (TimelineItem)__array2[__i2];
                    {
                        // Check if it is an actor event.
                        CinemaActorEvent cinemaEvent = item as CinemaActorEvent;
                        if (cinemaEvent != null)
                        {
                            if ((previousTime < cinemaEvent.Firetime) && (((time >= cinemaEvent.Firetime))))
                            {
                                {
                                    var __list7      = Actors;
                                    var __listCount7 = __list7.Count;
                                    for (int __i7 = 0; __i7 < __listCount7; ++__i7)
                                    {
                                        var actor = (Transform)__list7[__i7];
                                        {
                                            if (actor != null)
                                            {
                                                cinemaEvent.Trigger(actor.gameObject);
                                            }
                                        }
                                    }
                                }
                            }
                            else if (((previousTime >= cinemaEvent.Firetime) && (time < cinemaEvent.Firetime)))
                            {
                                {
                                    var __list8      = Actors;
                                    var __listCount8 = __list8.Count;
                                    for (int __i8 = 0; __i8 < __listCount8; ++__i8)
                                    {
                                        var actor = (Transform)__list8[__i8];
                                        {
                                            if (actor != null)
                                            {
                                                cinemaEvent.Reverse(actor.gameObject);
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        // Check if it is an actor action.
                        CinemaActorAction action = item as CinemaActorAction;
                        if (action != null)
                        {
                            {
                                var __list9      = Actors;
                                var __listCount9 = __list9.Count;
                                for (int __i9 = 0; __i9 < __listCount9; ++__i9)
                                {
                                    var actor = (Transform)__list9[__i9];
                                    {
                                        if (actor != null)
                                        {
                                            action.SetTime(actor.gameObject, (time - action.Firetime), time - previousTime);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }