maxhacker11

CrossFade.cs

Jan 16th, 2024
1,722
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | Source Code | 0 0
  1. using System.Collections;
  2. using UnityEngine;
  3. using DG.Tweening;
  4.  
  5. [System.Serializable]
  6. public class CrossFade : SceneTransition
  7. {
  8.     public CanvasGroup crossFade;
  9.    
  10.     public override IEnumerator AnimateTransitionIn()
  11.     {
  12.         var tweener = crossFade.DOFade(1f, 1f);
  13.         yield return tweener.WaitForCompletion();
  14.     }
  15.  
  16.     public override IEnumerator AnimateTransitionOut()
  17.     {
  18.         var tweener = crossFade.DOFade(0f, 1f);
  19.         yield return tweener.WaitForCompletion();
  20.     }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment