Ejemplo n.º 1
0
        protected override void StopEffect()
        {
            if (currentEffect)
            {
                currentEffect.Stop();
                currentEffect = null;
            }

            StopAllCoroutines();
        }
Ejemplo n.º 2
0
        private void DelayPlayEffect(UIEffectParameters effectParameters, float delay)
        {
            if (delay > Mathf.Epsilon)
            {
                StartCoroutine(PlayOneEffect(effectParameters, delay));
            }
            else
            {
                effectParameters.Effect.Play();
            }

            currentEffect = effectParameters.Effect;
        }
Ejemplo n.º 3
0
        protected override void PreparePlaying()
        {
            if (randomOrder)
            {
                effects.Shuffle();
            }

            if (effects.Count > 0)
            {
                effects[0].Effect.Prepare();
            }

            currentEffect = null;
            currentIndex  = 0;
        }
Ejemplo n.º 4
0
        private void OnEffectComplete()
        {
            currentEffect = null;

            if (currentIndex < effects.Count - 1)
            {
                currentIndex += 1;
                DelayPlayEffect(effects[currentIndex], effects[currentIndex].Delay);
            }
            else if (currentIndex == effects.Count - 1 && loop)
            {
                if (randomOrder)
                {
                    effects.Shuffle();
                }

                currentIndex = 0;
                DelayPlayEffect(effects[currentIndex], effects[currentIndex].Delay + loopInterval.Value);
            }
            else
            {
                SetSelfComplete();
            }
        }