I cannot seem to find out how I would go about generating an arbitrary number of FsmState objects for an FSM that was just created and added to a game object all through C#. I was able to create them by adding the PlaymakerFSM object to the game object first then creating an array of FsmState objects and assigning that to the Fsm. However when I go to move the states in the actual FSM in the Playmaker Editor, I receive an error for each mouse click when trying to move a state:
NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMakerEditor.FsmGraphView.UpdateGraphBounds (Vector2 viewPos, Single padding)
HutongGames.PlayMakerEditor.FsmGraphView.HandleMouseUp ()
HutongGames.PlayMakerEditor.FsmGraphView.HandleMouseEvents ()
HutongGames.PlayMakerEditor.FsmGraphView.DoCanvasView ()
HutongGames.PlayMakerEditor.FsmGraphView.OnGUI (Rect area)
HutongGames.PlayMakerEditor.FsmEditor.OnGUI ()
FsmEditorWindow.DoGUI () (at Assets/3rdParty/PlayMaker/PlayMaker/Editor/FsmEditorWindow.cs:94)
HutongGames.PlayMakerEditor.BaseEditorWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
I tried setting a Rect position for each state before assigning the array into the Fsm but still got the same problem. Any idea of what I am missing that Playmaker is saying is null that is required?