maxhacker11

CircleWipe.cs

Jan 16th, 2024
1,058
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | Source Code | 0 0
  1. using System.Collections;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. using DG.Tweening;
  5.  
  6. public class CircleWipe : SceneTransition
  7. {
  8. public Image circle;
  9.  
  10. public override IEnumerator AnimateTransitionIn()
  11. {
  12. circle.rectTransform.anchoredPosition = new Vector2(-1000f, 0f);
  13. var tweener = circle.rectTransform.DOAnchorPosX(0f, 1f);
  14. yield return tweener.WaitForCompletion();
  15. }
  16.  
  17. public override IEnumerator AnimateTransitionOut()
  18. {
  19. var tweener = circle.rectTransform.DOAnchorPosX(1000f, 1f);
  20. yield return tweener.WaitForCompletion();
  21. }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment