Created
December 9, 2016 16:09
-
-
Save litswd0211/e7a74edda2f22bcff1caf8e328fb1120 to your computer and use it in GitHub Desktop.
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; | |
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