Exemplo n.º 1
0
        /// <summary>
        /// This function will skip the timeline time to the time passed, any event that is flagged to fire when skipped
        /// (None by default) will not fired.
        /// </summary>
        public override void SkipTimelineTo(float time)
        {
            float prevElapsedTime = elapsedTime;

            elapsedTime = time;

            foreach (Transform child in transform)
            {
                USEventBase baseEvent = child.GetComponent <USEventBase>();
                if (!baseEvent)
                {
                    continue;
                }

                bool shouldSkipEvent = !baseEvent.IsFireAndForgetEvent || !baseEvent.FireOnSkip;
                if (shouldSkipEvent)
                {
                    continue;
                }

                if ((prevElapsedTime < baseEvent.FireTime || prevElapsedTime <= 0.0f) && time > baseEvent.FireTime)
                {
                    if (Sequence.IsPlaying && baseEvent.AffectedObject)
                    {
                        baseEvent.FireEvent();
                    }
                }
            }
        }
Exemplo n.º 2
0
 private void FireEvent(USEventBase baseEvent, float prevElapsedTime, float elapsedTime)
 {
     if ((prevElapsedTime < baseEvent.FireTime || prevElapsedTime <= 0f) && elapsedTime >= baseEvent.FireTime && baseEvent.AffectedObject)
     {
         baseEvent.FireEvent();
     }
 }
Exemplo n.º 3
0
        public override void SkipTimelineTo(float time)
        {
            float num = this.elapsedTime;

            this.elapsedTime = time;
            foreach (Transform transform in base.transform)
            {
                USEventBase component = transform.GetComponent <USEventBase>();
                if (component)
                {
                    bool flag = !component.IsFireAndForgetEvent || !component.FireOnSkip;
                    if (!flag)
                    {
                        if ((num < component.FireTime || num <= 0f) && time > component.FireTime && base.Sequence.IsPlaying && component.AffectedObject)
                        {
                            component.FireEvent();
                        }
                    }
                }
            }
        }