Skip to content

Commit c52a449

Browse files
committed
Add chaining method for setting scene index
1 parent ec2c60d commit c52a449

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Runtime/PropertyChaining.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ public static T SetId<T>(this T tween, int id) where T: Tween
5858
return tween;
5959
}
6060

61+
/// <summary>
62+
/// Sets the scene index of the tween to the given value.
63+
/// </summary>
64+
/// <param name="tween">The tween to assign the value to.</param>
65+
/// <param name="index">The scene index to set.</param>
66+
/// <returns>The tween itself to allow for chaining.</returns>
67+
/// <typeparam name="T">The type of the tween.</typeparam>
68+
public static T SetSceneIndex<T>(this T tween, int index) where T: Tween
69+
{
70+
tween.sceneIndex = index;
71+
return tween;
72+
}
73+
6174
/// <summary>
6275
/// Sets the ease of the tween to the given value.
6376
/// </summary>

0 commit comments

Comments
 (0)