Esempio n. 1
0
        public override void Run(GameObject target, TweenActionSettings s)
        {
            Text textComponent = target.GetComponent <Text>();

            if (textComponent == null)
            {
                Debug.Log("Test error! Can't test ValueTween. Select text component before.");
            }
            else
            {
                bool isIntegerValue = Random.Range(0, 2) == 0;
                if (isIntegerValue)
                {
                    ValueTween.Run(target, 10, 100, s.Duration,
                                   iValue =>
                    {
                        textComponent.text = iValue.ToString();
                    }).SetEase(s.Ease).SetDelay(s.Delay);
                }
                else
                {
                    ValueTween.Run(target, 100f, 10f, s.Duration,
                                   fValue =>
                    {
                        textComponent.text = fValue.ToString("F");
                    }).SetEase(s.Ease).SetDelay(s.Delay);
                }
            }
        }
Esempio n. 2
0
        private IEnumerator KickSequenceCoroutine(GameObject target, TweenActionSettings settings)
        {
            yield return(KickTween.RunLeft(target, 100f).WaitForFinish());

            yield return(KickTween.RunRight(target, 100f).WaitForFinish());

            TweenBase tween = KickTween.RunUp(target, 100f);

            while (tween.IsRunning())
            {
                yield return(null);
            }

            tween = KickTween.RunDown(target, 100f);
            yield return(new WaitForSeconds(0.01f));

            Object.DestroyImmediate(tween);

            if (tween.IsFinished())
            {
                yield return(KickTween.RunDown(target, 100f).WaitForFinish());
            }

            KickTween.RunDirection(target, 100f, new Vector2(2f, 1.5f));
        }
Esempio n. 3
0
 public override void Run(GameObject target, TweenActionSettings settings)
 {
     ColorFlashTween.Run(target, settings.Color, settings.Duration)
     .SetDelay(settings.Delay)
     .SetEase(settings.Ease)
     .Single();
 }
Esempio n. 4
0
        public override void Run(GameObject target, TweenActionSettings settings)
        {
            CoroutinesHoster.StartCoroutine(KickSequenceCoroutine(target, settings));

            //TweenSequence.Run5(
            //() => KickTween.RunLeft(target, 100f),
            //() => KickTween.RunRight(target, 100f),
            //() => KickTween.RunUp(target, 100f),
            //() => KickTween.RunDown(target, 100f),
            //() => KickTween.RunDirection(target, 100f, new Vector2(4f, 3f)));
        }
Esempio n. 5
0
        public override void Run(GameObject target, TweenActionSettings s)
        {
            int example = Random.Range(0, 2);

            if (example == 0)
            {
                MoveToTween.Run(target, GetRandomScreenPoint(), s.Duration).SetLocal(true).SetDelay(s.Delay).SetEase(s.Ease);
            }
            else if (example == 1)
            {
                MoveToTween.RunX(target, GetRandomScreenPoint().x, s.Duration).SetLocal(true).SetDelay(s.Delay).SetEase(s.Ease);
            }
        }
Esempio n. 6
0
        public override void Run(GameObject target, TweenActionSettings settings)
        {
            int variant = Random.Range(0, 3);

            if (variant == 0)
            {
                ShakeAngleTween.Run(target, 10f, settings.Duration).Single();
            }
            else if (variant == 1)
            {
                ShakeAngleTween.Run(target, 20f, 0.25f).SetPhasesCount(2).Single();
            }
            else if (variant == 2)
            {
                ShakeAngleTween.Run(Camera.main.gameObject, 10f, 0.25f).SetPhasesCount(2).Single();
            }
        }
Esempio n. 7
0
 public override void Run(GameObject target, TweenActionSettings s)
 {
     if (Random.Range(0, 2) == 0)
     {
         Debug.Log("ShakeTween.Run.");
         TweenSequence.Run3(
             () => ShakeTween.Run(target, 25, s.Duration),
             () => ShakeTween.RunUp(target, 25, s.Duration),
             () => ShakeTween.Run(target, 25, new Vector2(3f, 1f), s.Duration));
     }
     else
     {
         Debug.Log("ShakeTween.Run.Local.");
         TweenSequence.Run3(
             () => ShakeTween.Run(target, 25, s.Duration).SetLocal(),
             () => ShakeTween.RunUp(target, 25, s.Duration).SetLocal(),
             () => ShakeTween.Run(target, 25, new Vector2(3f, 1f), s.Duration).SetLocal());
     }
 }
Esempio n. 8
0
        public override void Run(GameObject target, TweenActionSettings s)
        {
            int variant = Random.Range(0, 3);

            if (variant == 0)
            {
                TweenSequence.Run2(
                    () => ScaleTween.Run(target, Vector3.zero, s.Duration).SetEase(s.Ease).SetDelay(s.Delay),
                    () => ScaleTween.Run(target, Vector3.one, s.Duration).SetEase(s.Ease));
            }
            else if (variant == 1)
            {
                TweenSequence.Run2(
                    () => ScaleTween.RunX(target, 0f, s.Duration).SetEase(s.Ease).SetDelay(s.Delay),
                    () => ScaleTween.RunX(target, 1f, s.Duration).SetEase(s.Ease));
            }
            else if (variant == 2)
            {
                TweenSequence.Run2(
                    () => ScaleTween.RunY(target, 0f, s.Duration).SetEase(s.Ease).SetDelay(s.Delay),
                    () => ScaleTween.RunY(target, 1f, s.Duration).SetEase(s.Ease));
            }
        }
Esempio n. 9
0
 public abstract void Run(GameObject target, TweenActionSettings settings);
Esempio n. 10
0
 public override void Run(GameObject target, TweenActionSettings s)
 {
     TweenSequence.Run2(
         () => FadeOutTween.Run(target, s.Duration).SetEase(s.Ease),
         () => FadeInTween.Run(target, s.Duration).SetEase(s.Ease));
 }
Esempio n. 11
0
 public override void Run(GameObject target, TweenActionSettings s)
 {
     NumberRunTween.Run(target, 1, 99, s.Duration).SetEase(s.Ease).SetDelay(s.Delay);
 }
Esempio n. 12
0
 public override void Run(GameObject target, TweenActionSettings s)
 {
     Jump2DTween.Run(target, GetRandomScreenPoint(), s.Duration).SetJumpYOffset(100).SetDelay(s.Delay);
 }