コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】DOTween.Tweenがnullではない場合にのみKill関数を呼び出す拡張メソッド

ソースコード

/// <summary>
/// Tween 型の拡張メソッドを管理するクラス
/// </summary>
public static class TweenExt
{
    /// <summary>
    /// Sequence を削除します
    /// </summary>
    public static void KillIfNotNull( this Tween self, bool complete = false )
    {
        if ( self == null ) return;
        self.Kill( complete );
    }
}