Skip to content

Commit 65925b2

Browse files
committed
BaseSubStateMachineState - Added a call to ReplaceModelWithActiveModel after creating the state machine in SwitchModel
1 parent c2da20b commit 65925b2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Runtime/StateGraph/States/BaseSubStateMachineState.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ protected virtual void SwitchModel(StateMachineModel value)
8585

8686
_model = value;
8787
CreateStateMachine();
88+
ReplaceModelWithActiveModel();
8889

8990
if (!GameObject.activeInHierarchy || !_started) return;
9091
SubStateMachine?.Start();
@@ -106,14 +107,14 @@ protected virtual void OnSubStateComplete(State state, StateMachineModel model)
106107
//...
107108
}
108109

109-
private void ReplaceModelWithActiveModel()
110+
protected virtual void ReplaceModelWithActiveModel()
110111
{
111112
if (SubStateMachine == null) return;
112113

113114
_model = SubStateMachine.Model;
114115
}
115116

116-
private void ReplaceModelWithOriginalModel()
117+
protected virtual void ReplaceModelWithOriginalModel()
117118
{
118119
if (!_model) return;
119120

0 commit comments

Comments
 (0)