Skip to content

Instantly share code, notes, and snippets.

@litswd0211
Created December 9, 2016 16:09
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 litswd0211/e7a74edda2f22bcff1caf8e328fb1120 to your computer and use it in GitHub Desktop.
Save litswd0211/e7a74edda2f22bcff1caf8e328fb1120 to your computer and use it in GitHub Desktop.
using DG.Tweening;
public static class DOTweenExtensions
{
public static void SafeKill(this Tween self, bool complete = false)
{
if (self != null)
{
self.Kill(complete);
}
}
public static void SafePause(this Tween self)
{
if (self != null)
{
self.Pause();
}
}
public static void SafePlay(this Tween self)
{
if (self != null)
{
self.Play();
}
}
public static void SafeRestart(this Tween self)
{
if (self != null)
{
self.Restart();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment