Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/FsmUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,11 @@ public static void AddMethod(this FsmState state, Action<FsmStateAction> method)
[PublicAPI]
public static void AddMethod(this FsmState state, Action method, bool everyFrame = false)
{
LambdaAction action = new LambdaAction { Method = method };
LambdaAction action = new()
{
Method = method,
EveryFrame = everyFrame,
};
state.AddAction(action);
}

Expand Down Expand Up @@ -682,14 +686,19 @@ public static void InsertMethod(this FsmState state, int index, Action<FsmStateA
/// <param name="state">The fsm state</param>
/// <param name="method">The method that will be invoked</param>
/// <param name="index">The index to place the action in</param>
/// <param name="everyFrame">Whether to execute 'method' on every update frame</param>
[PublicAPI]
public static void InsertMethod(this FsmState state, Action method, int index, bool everyFrame = false) => state.InsertMethod(index, method, everyFrame);

/// <inheritdoc cref="InsertMethod(FsmState, Action, int, bool)"/>
[PublicAPI]
public static void InsertMethod(this FsmState state, int index, Action method, bool everyFrame = false)
{
LambdaAction action = new LambdaAction { Method = method };
LambdaAction action = new()
{
Method = method,
EveryFrame = everyFrame,
};
state.InsertAction(action, index);
}

Expand Down