private void SaveDuration()
            {
                List <Duration> durations = new List <Duration>(StateMachineReflections.GetDurations(stateMachine));

                durations[stateIndex] = duration;
                StateMachineReflections.SetDurations(stateMachine, durations.ToArray());
            }
 private void SaveStateMachine(Action[][] actions, bool[][] isDurationEnd, Duration[] durations, Condition[][][] conditions)
 {
     StateMachineReflections.SetTransitions(stateMachine, transitions.Select(a => a.ToArray()).ToArray());
     StateMachineReflections.SetActions(stateMachine, actions);
     StateMachineReflections.SetIsDurationsEnd(stateMachine, isDurationEnd);
     StateMachineReflections.SetDurations(stateMachine, durations);
     StateMachineReflections.SetConditions(stateMachine, conditions);
 }