Created
September 6, 2022 15:12
-
-
Save dyguests/9dacb7d64ff1744f76221a82f22436f4 to your computer and use it in GitHub Desktop.
DOTween Extra Tools.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DG.Tweening; | |
using DG.Tweening.Core; | |
using DG.Tweening.Plugins.Options; | |
using UnityEngine; | |
namespace Tools | |
{ | |
public static class DOTweenEx | |
{ | |
public static TweenerCore<float, float, FloatOptions> DOAlpha( | |
this CanvasGroup target, | |
float endValue, | |
float duration, | |
bool snapping = false | |
) | |
{ | |
var t = DOTween.To(() => target.alpha, x => target.alpha = x, endValue, duration); | |
t.SetOptions(snapping).SetTarget(target); | |
return t; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment