public void SyncStates() { var state = _stateMachine.Current; _stateMachine.ChangeState((IAIState)null); _stateMachine.SetStateMachine(TypedStateMachine <IAIState> .CreateFromParentComponentSource(this.gameObject, false, true)); if (state != null && _stateMachine.Contains(state)) { _stateMachine.ChangeState(state); } }