DigiXrosEffectObject.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using DG.Tweening;
  5. using UnityEngine.UI;
  6. public class DigiXrosEffectObject : EvolutionEffectObject
  7. {
  8. [SerializeField] GameObject digiXrosAnimParent;
  9. public override IEnumerator EvolutionEffectAnimation(CardSource cardSource, CardSource[] jogressEvoRoots = null, string message = "")
  10. {
  11. if (ContinuousController.instance != null)
  12. {
  13. if (!ContinuousController.instance.showCutInAnimation)
  14. {
  15. animTime = 2f;
  16. yield break;
  17. }
  18. }
  19. animTime = 2f;
  20. yield return ContinuousController.instance.StartCoroutine(base.EvolutionEffectAnimation(cardSource, jogressEvoRoots));
  21. }
  22. public void Shake()
  23. {
  24. StartCoroutine(ShakeIEnumerator());
  25. }
  26. public void PlaySlashSE()
  27. {
  28. ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BattleSE);
  29. }
  30. IEnumerator ShakeIEnumerator()
  31. {
  32. bool end = false;
  33. float shakeTime = 0.3f;
  34. Sequence sequence = DOTween.Sequence();
  35. sequence
  36. .Append(digiXrosAnimParent.transform.DOShakePosition(shakeTime, strength: 16f, vibrato: 50, fadeOut: true))
  37. .AppendCallback(() => end = true);
  38. sequence.Play();
  39. yield return new WaitWhile(() => !end);
  40. end = false;
  41. sequence.Kill();
  42. }
  43. }