Skip to content

Instantly share code, notes, and snippets.

@dyguests
Created September 6, 2022 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dyguests/9dacb7d64ff1744f76221a82f22436f4 to your computer and use it in GitHub Desktop.
Save dyguests/9dacb7d64ff1744f76221a82f22436f4 to your computer and use it in GitHub Desktop.
DOTween Extra Tools.
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