Skip to content

Commit

Permalink
Merge pull request #160 from AnnulusGames/preserve-method-chaining
Browse files Browse the repository at this point in the history
Add return value of `MotionHandle.Preserve()` for method chaining
  • Loading branch information
AnnulusGames authored Dec 6, 2024
2 parents 0095c20 + 0fcc6cb commit 7e1609e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ public static bool IsActive(this MotionHandle handle)
return MotionManager.IsActive(handle);
}

/// <summary>
/// Preserves the MotionHandle so that it is not destroyed until Cancel() is explicitly called.
/// </summary>
/// <param name="handle">This motion handle</param>
/// <returns>Returns itself for method chaining</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Preserve(this MotionHandle handle)
public static MotionHandle Preserve(this MotionHandle handle)
{
MotionManager.GetDataRef(handle).IsPreserved = true;
return handle;
}

/// <summary>
Expand Down

0 comments on commit 7e1609e

Please sign in to comment.