/// <summary>
        /// Update this track since the last frame.
        /// </summary>
        /// <param name="time">The new running time.</param>
        /// <param name="deltaTime">The deltaTime since last update.</param>
        public override void UpdateTrack(float time, float deltaTime)
        {
#if PROFILE_FILE
            Profiler.BeginSample("ActorItemTrack.UpdateTrack");
#endif // PROFILE_FILE
            float previousTime = base.elapsedTime;
            base.UpdateTrack(time, deltaTime);

            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)) && (((base.elapsedTime >= 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);
                            }
                        }
                    }
                    if (((previousTime >= cinemaEvent.Firetime) && (base.elapsedTime < 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);
                            }
                        }
                    }
                }

                CinemaActorAction action = item as CinemaActorAction;
                if (action != null)
                {
                    if ((previousTime < action.Firetime && base.elapsedTime >= action.Firetime) && base.elapsedTime < action.EndTime)
                    {
                        var actorList = Actors;
                        var count     = actorList.Count;
                        for (var j = 0; j < count; j++)
                        {
                            var actor = actorList[j];
                            if (actor != null)
                            {
                                action.Trigger(actor.gameObject);
                            }
                        }
                    }
                    else if (previousTime <= action.EndTime && base.elapsedTime > action.EndTime)
                    {
                        var actorList = Actors;
                        var count     = actorList.Count;
                        for (var j = 0; j < count; j++)
                        {
                            var actor = actorList[j];
                            if (actor != null)
                            {
                                action.End(actor.gameObject);
                            }
                        }
                    }
                    else if (previousTime >= action.Firetime && previousTime < action.EndTime && base.elapsedTime < action.Firetime)
                    {
                        var actorList = Actors;
                        var count     = actorList.Count;
                        for (var j = 0; j < count; j++)
                        {
                            var actor = actorList[j];
                            if (actor != null)
                            {
                                action.ReverseTrigger(actor.gameObject);
                            }
                        }
                    }
                    else if ((previousTime > action.EndTime && (base.elapsedTime > action.Firetime) && (base.elapsedTime <= action.EndTime)))
                    {
                        var actorList = Actors;
                        var count     = actorList.Count;
                        for (var j = 0; j < count; j++)
                        {
                            var actor = actorList[j];
                            if (actor != null)
                            {
                                action.ReverseEnd(actor.gameObject);
                            }
                        }
                    }
                    else if ((base.elapsedTime > action.Firetime) && (base.elapsedTime <= action.EndTime))
                    {
                        var actorList = Actors;
                        var count     = actorList.Count;
                        for (var j = 0; j < count; j++)
                        {
                            var actor = actorList[j];
                            if (actor != null)
                            {
                                float runningTime = time - action.Firetime;
                                action.UpdateTime(actor.gameObject, runningTime, deltaTime);
                            }
                        }
                    }
                }
            }
#if PROFILE_FILE
            Profiler.EndSample();
#endif // PROFILE_FILE
        }
Exemple #2
0
        /// <summary>
        /// Update this track since the last frame.
        /// </summary>
        /// <param name="time">The new running time.</param>
        /// <param name="deltaTime">The deltaTime since last update.</param>
        public override void UpdateTrack(float time, float deltaTime)
        {
            float previousTime = base.elapsedTime;

            base.UpdateTrack(time, deltaTime);

            //GetActors(ref _actorList);

            List <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 && base.elapsedTime <= cinemaEvent.Firetime)
                    {
                        for (int j = 0; j < _actorList.Count; j++)
                        {
                            if (_actorList[j] != null)
                            {
                                cinemaEvent.Reverse(_actorList[j].gameObject);
                            }
                        }
                    }
                }

                CinemaActorAction action = items[i] as CinemaActorAction;
                if (action != null)
                {
                    var actionScene = action.GetCutScene();
                    if (((previousTime < action.Firetime || previousTime <= 0f) && base.elapsedTime >= action.Firetime) && base.elapsedTime < action.EndTime)
                    {
                        for (int j = 0; j < _actorList.Count; j++)
                        {
                            if (_actorList[j] != null)
                            {
                                action.Trigger(_actorList[j].gameObject);
                            }
                        }
                    }
                    else if (previousTime <= action.EndTime && base.elapsedTime >= action.EndTime)
                    {
                        for (int j = 0; j < _actorList.Count; j++)
                        {
                            if (_actorList[j] != null)
                            {
                                action.End(_actorList[j].gameObject);
                            }
                        }
                    }
                    else if (previousTime >= action.Firetime && previousTime < action.EndTime && base.elapsedTime <= action.Firetime)
                    {
                        for (int j = 0; j < _actorList.Count; j++)
                        {
                            if (_actorList[j] != null)
                            {
                                action.ReverseTrigger(_actorList[j].gameObject);
                            }
                        }
                    }
                    else if (((previousTime > action.EndTime || (actionScene != null && previousTime >= actionScene.Duration)) && (base.elapsedTime > action.Firetime) && (base.elapsedTime <= action.EndTime)))
                    {
                        for (int j = 0; j < _actorList.Count; j++)
                        {
                            if (_actorList[j] != null)
                            {
                                action.ReverseEnd(_actorList[j].gameObject);
                            }
                        }
                    }
                    else if ((base.elapsedTime > action.Firetime) && (base.elapsedTime <= action.EndTime))
                    {
                        for (int j = 0; j < _actorList.Count; j++)
                        {
                            if (_actorList[j] != null)
                            {
                                float runningTime = time - action.Firetime;
                                action.UpdateTime(_actorList[j].gameObject, runningTime, deltaTime);
                            }
                        }
                    }
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// Update this track since the last frame.
        /// </summary>
        /// <param name="time">The new running time.</param>
        /// <param name="deltaTime">The deltaTime since last update.</param>
        public override void UpdateTrack(float time, float deltaTime)
        {
            if (mute)
            {
                return;
            }
            float previousTime = base.elapsedTime;

            base.UpdateTrack(time, deltaTime);

            TimelineItem[] items = GetTimelineItems();
            for (int i = 0; i < items.Length; 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 < Actors.Count; j++)
                        {
                            if (Actors[j] != null)
                            {
                                cinemaEvent.Trigger(Actors[j].gameObject);
                            }
                        }
                    }
                    else if (previousTime >= cinemaEvent.Firetime && base.elapsedTime <= cinemaEvent.Firetime)
                    {
                        for (int j = 0; j < Actors.Count; j++)
                        {
                            if (Actors[j] != null)
                            {
                                cinemaEvent.Reverse(Actors[j].gameObject);
                            }
                        }
                    }
                }

                CinemaActorAction action = items[i] as CinemaActorAction;
                if (action != null)
                {
                    if (((previousTime < action.Firetime || previousTime <= 0f) && base.elapsedTime >= action.Firetime) && base.elapsedTime < action.EndTime)
                    {
                        for (int j = 0; j < Actors.Count; j++)
                        {
                            if (Actors[j] != null)
                            {
                                action.Trigger(Actors[j].gameObject);
                            }
                        }
                    }
                    else if (previousTime <= action.EndTime && base.elapsedTime >= action.EndTime)
                    {
                        for (int j = 0; j < Actors.Count; j++)
                        {
                            if (Actors[j] != null)
                            {
                                action.End(Actors[j].gameObject);
                            }
                        }
                    }
                    else if (previousTime >= action.Firetime && previousTime < action.EndTime && base.elapsedTime <= action.Firetime)
                    {
                        for (int j = 0; j < Actors.Count; j++)
                        {
                            if (Actors[j] != null)
                            {
                                action.ReverseTrigger(Actors[j].gameObject);
                            }
                        }
                    }
                    else if (((previousTime > action.EndTime || previousTime >= action.Cutscene.Duration) && (base.elapsedTime > action.Firetime) && (base.elapsedTime <= action.EndTime)))
                    {
                        for (int j = 0; j < Actors.Count; j++)
                        {
                            if (Actors[j] != null)
                            {
                                action.ReverseEnd(Actors[j].gameObject);
                            }
                        }
                    }
                    else if ((base.elapsedTime > action.Firetime) && (base.elapsedTime <= action.EndTime))
                    {
                        for (int j = 0; j < Actors.Count; j++)
                        {
                            if (Actors[j] != null)
                            {
                                float runningTime = time - action.Firetime;
                                action.UpdateTime(Actors[j].gameObject, runningTime, deltaTime);
                            }
                        }
                    }
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// Update this track since the last frame.
        /// </summary>
        /// <param name="time">The new running time.</param>
        /// <param name="deltaTime">The deltaTime since last update.</param>
        public override void UpdateTrack(float time, float deltaTime)
        {
            float previousTime = base.elapsedTime;

            base.UpdateTrack(time, deltaTime);

            TimelineItem[] items = GetTimelineItems();
            foreach (TimelineItem item in items)
            {
                // Check if it is an actor event.
                CinemaActorEvent cinemaEvent = item as CinemaActorEvent;
                if (cinemaEvent != null)
                {
                    if ((previousTime < cinemaEvent.Firetime) && (((base.elapsedTime >= cinemaEvent.Firetime))))
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                cinemaEvent.Trigger(actor.gameObject);
                            }
                        }
                    }
                    if (((previousTime >= cinemaEvent.Firetime) && (base.elapsedTime < cinemaEvent.Firetime)))
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                cinemaEvent.Reverse(actor.gameObject);
                            }
                        }
                    }
                }

                CinemaActorAction action = item as CinemaActorAction;
                if (action != null)
                {
                    if ((previousTime < action.Firetime && base.elapsedTime >= action.Firetime) && base.elapsedTime < action.EndTime)
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                action.Trigger(actor.gameObject);
                            }
                        }
                    }
                    else if (previousTime <= action.EndTime && base.elapsedTime > action.EndTime)
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                action.End(actor.gameObject);
                            }
                        }
                    }
                    else if (previousTime >= action.Firetime && previousTime < action.EndTime && base.elapsedTime < action.Firetime)
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                action.ReverseTrigger(actor.gameObject);
                            }
                        }
                    }
                    else if ((previousTime > action.EndTime && (base.elapsedTime > action.Firetime) && (base.elapsedTime <= action.EndTime)))
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                action.ReverseEnd(actor.gameObject);
                            }
                        }
                    }
                    else if ((base.elapsedTime > action.Firetime) && (base.elapsedTime <= action.EndTime))
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                float runningTime = time - action.Firetime;
                                action.UpdateTime(actor.gameObject, runningTime, deltaTime);
                            }
                        }
                    }
                }
            }
        }
Exemple #5
0
        public override void UpdateTrack(float time, float deltaTime)
        {
            float previousTime = elapsedTime;

            base.UpdateTrack(time, deltaTime);
            TimelineItem[] items = GetTimelineItems();
            foreach (TimelineItem item in items)
            {
                CinemaActorEvent cinemaEvent = item as CinemaActorEvent;
                if (cinemaEvent != null)
                {
                    if (previousTime <= cinemaEvent.Firetime && elapsedTime > cinemaEvent.Firetime)
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                cinemaEvent._time = 0;
                                cinemaEvent.Trigger(actor.gameObject);
                            }
                        }
                    }
                    #if UNITY_EDITOR
                    else if (elapsedTime > cinemaEvent.Firetime)
                    {
                        if (!Application.isPlaying)
                        {
                            foreach (Transform actor in Actors)
                            {
                                if (actor != null)
                                {
                                    cinemaEvent.UpdateTrack(actor.gameObject, time, deltaTime);
                                }
                            }
                        }
                    }
                    #endif
                    if (((previousTime >= cinemaEvent.Firetime) && (elapsedTime < cinemaEvent.Firetime)))
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                cinemaEvent.Reverse(actor.gameObject);
                            }
                        }
                    }
                }

                CinemaActorAction action = item as CinemaActorAction;
                if (action != null)
                {
                    if ((previousTime <= action.Firetime && elapsedTime > action.Firetime) && elapsedTime < action.EndTime)
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                action.Trigger(actor.gameObject);
                            }
                        }
                    }
                    else if (previousTime <= action.EndTime && elapsedTime > action.EndTime)
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                action.End(actor.gameObject);
                            }
                        }
                    }
                    else if (previousTime >= action.Firetime && previousTime < action.EndTime && elapsedTime < action.Firetime)
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                action.ReverseTrigger(actor.gameObject);
                            }
                        }
                    }
                    else if ((previousTime > action.EndTime && (elapsedTime > action.Firetime) && (elapsedTime <= action.EndTime)))
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                action.ReverseEnd(actor.gameObject);
                            }
                        }
                    }
                    else if ((elapsedTime > action.Firetime) && (elapsedTime <= action.EndTime))
                    {
                        foreach (Transform actor in Actors)
                        {
                            if (actor != null)
                            {
                                float runningTime = time - action.Firetime;
                                action.UpdateTime(actor.gameObject, runningTime, deltaTime);
                            }
                        }
                    }
                }
            }
        }
Exemple #6
0
        /// <summary>
        /// Update this track since the last frame.
        /// </summary>
        /// <param name="time">The new running time.</param>
        /// <param name="deltaTime">The deltaTime since last update.</param>
        public override void UpdateTrack(float time, float deltaTime)
        {
            float previousTime = base.elapsedTime;

            base.UpdateTrack(time, deltaTime);
            {
                var __array3       = GetTimelineItems();
                var __arrayLength3 = __array3.Length;
                for (int __i3 = 0; __i3 < __arrayLength3; ++__i3)
                {
                    var item = (TimelineItem)__array3[__i3];
                    {
                        // Check if it is an actor event.
                        CinemaActorEvent cinemaEvent = item as CinemaActorEvent;
                        if (cinemaEvent != null)
                        {
                            if ((previousTime < cinemaEvent.Firetime) && (((base.elapsedTime >= cinemaEvent.Firetime))))
                            {
                                {
                                    var __list10      = Actors;
                                    var __listCount10 = __list10.Count;
                                    for (int __i10 = 0; __i10 < __listCount10; ++__i10)
                                    {
                                        var actor = (Transform)__list10[__i10];
                                        {
                                            if (actor != null)
                                            {
                                                cinemaEvent.Trigger(actor.gameObject);
                                            }
                                        }
                                    }
                                }
                            }
                            if (((previousTime >= cinemaEvent.Firetime) && (base.elapsedTime < cinemaEvent.Firetime)))
                            {
                                {
                                    var __list11      = Actors;
                                    var __listCount11 = __list11.Count;
                                    for (int __i11 = 0; __i11 < __listCount11; ++__i11)
                                    {
                                        var actor = (Transform)__list11[__i11];
                                        {
                                            if (actor != null)
                                            {
                                                cinemaEvent.Reverse(actor.gameObject);
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        CinemaActorAction action = item as CinemaActorAction;
                        if (action != null)
                        {
                            if ((previousTime < action.Firetime && base.elapsedTime >= action.Firetime) && base.elapsedTime < action.EndTime)
                            {
                                {
                                    var __list12      = Actors;
                                    var __listCount12 = __list12.Count;
                                    for (int __i12 = 0; __i12 < __listCount12; ++__i12)
                                    {
                                        var actor = (Transform)__list12[__i12];
                                        {
                                            if (actor != null)
                                            {
                                                action.Trigger(actor.gameObject);
                                            }
                                        }
                                    }
                                }
                            }
                            else if (previousTime <= action.EndTime && base.elapsedTime > action.EndTime)
                            {
                                {
                                    var __list13      = Actors;
                                    var __listCount13 = __list13.Count;
                                    for (int __i13 = 0; __i13 < __listCount13; ++__i13)
                                    {
                                        var actor = (Transform)__list13[__i13];
                                        {
                                            if (actor != null)
                                            {
                                                action.End(actor.gameObject);
                                            }
                                        }
                                    }
                                }
                            }
                            else if (previousTime >= action.Firetime && previousTime < action.EndTime && base.elapsedTime < action.Firetime)
                            {
                                {
                                    var __list14      = Actors;
                                    var __listCount14 = __list14.Count;
                                    for (int __i14 = 0; __i14 < __listCount14; ++__i14)
                                    {
                                        var actor = (Transform)__list14[__i14];
                                        {
                                            if (actor != null)
                                            {
                                                action.ReverseTrigger(actor.gameObject);
                                            }
                                        }
                                    }
                                }
                            }
                            else if ((previousTime > action.EndTime && (base.elapsedTime > action.Firetime) && (base.elapsedTime <= action.EndTime)))
                            {
                                {
                                    var __list15      = Actors;
                                    var __listCount15 = __list15.Count;
                                    for (int __i15 = 0; __i15 < __listCount15; ++__i15)
                                    {
                                        var actor = (Transform)__list15[__i15];
                                        {
                                            if (actor != null)
                                            {
                                                action.ReverseEnd(actor.gameObject);
                                            }
                                        }
                                    }
                                }
                            }
                            else if ((base.elapsedTime > action.Firetime) && (base.elapsedTime <= action.EndTime))
                            {
                                {
                                    var __list16      = Actors;
                                    var __listCount16 = __list16.Count;
                                    for (int __i16 = 0; __i16 < __listCount16; ++__i16)
                                    {
                                        var actor = (Transform)__list16[__i16];
                                        {
                                            if (actor != null)
                                            {
                                                float runningTime = time - action.Firetime;
                                                action.UpdateTime(actor.gameObject, runningTime, deltaTime);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }