Skip to content

Commit

Permalink
uncomment FSMUtil code
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashant Mohta committed Sep 13, 2021
1 parent 0f74c02 commit 279200d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Utils/FsmUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static FsmEvent AddTransition(this PlayMakerFSM fsm, string stateName, st
list.Add(new FsmTransition
{
ToState = toState,
//ToFsmState = fsm.GetState(toState),
ToFsmState = fsm.GetState(toState),
FsmEvent = ret
});
state.Transitions = list.ToArray();
Expand All @@ -81,7 +81,7 @@ public static FsmEvent AddGlobalTransition(this PlayMakerFSM fsm, string globalE
tmpFsmGlobalTransitions.Add(new FsmTransition
{
ToState = toState,
//ToFsmState = fsm.GetState(toState),
ToFsmState = fsm.GetState(toState),
FsmEvent = ret
});
fsm.Fsm.GlobalTransitions = tmpFsmGlobalTransitions.ToArray();
Expand All @@ -93,7 +93,7 @@ public static void ChangeTransition(this PlayMakerFSM fsm, string stateName, str
var state = fsm.Fsm.GetState(stateName);
var transition = state.Transitions.First(t => t.EventName.Equals(eventName));
transition.ToState = toState;
//transition.ToFsmState = fsm.GetState(toState);
transition.ToFsmState = fsm.GetState(toState);
}

public static FsmState GetState(this PlayMakerFSM fsm, string stateName)
Expand All @@ -107,10 +107,10 @@ public static FsmState CopyState(this PlayMakerFSM fsm, string fromState, string
{
Name = toState
};
//foreach (var t in copy.Transitions)
//{
// t.ToFsmState = fsm.GetState(t.ToState);
//}
foreach (var t in copy.Transitions)
{
t.ToFsmState = fsm.GetState(t.ToState);
}
List<FsmState> tmpList = new List<FsmState>(fsm.FsmStates);
tmpList.Add(copy);
fsm.Fsm.States = tmpList.ToArray();
Expand Down

0 comments on commit 279200d

Please sign in to comment.