private void OnGUI()
 {
     base.set_useGUILayout(this.enableGUILayout);
     if (PlayMakerGUI.GUISkin != null)
     {
         GUI.set_skin(PlayMakerGUI.GUISkin);
     }
     GUI.set_color(PlayMakerGUI.GUIColor);
     GUI.set_backgroundColor(PlayMakerGUI.GUIBackgroundColor);
     GUI.set_contentColor(PlayMakerGUI.GUIContentColor);
     if (this.previewOnGUI && !Application.get_isPlaying())
     {
         PlayMakerGUI.DoEditGUI();
         return;
     }
     PlayMakerGUI.fsmList.Clear();
     PlayMakerGUI.fsmList.AddRange(PlayMakerFSM.FsmList);
     for (int i = 0; i < PlayMakerGUI.fsmList.get_Count(); i++)
     {
         PlayMakerFSM playMakerFSM = PlayMakerGUI.fsmList.get_Item(i);
         if (!(playMakerFSM == null) && playMakerFSM.Active && playMakerFSM.Fsm.ActiveState != null && !playMakerFSM.Fsm.HandleOnGUI)
         {
             this.CallOnGUI(playMakerFSM.Fsm);
             for (int j = 0; j < playMakerFSM.Fsm.SubFsmList.get_Count(); j++)
             {
                 Skill fsm = playMakerFSM.Fsm.SubFsmList.get_Item(j);
                 this.CallOnGUI(fsm);
             }
         }
     }
     if (Application.get_isPlaying() && Event.get_current().get_type() == 7)
     {
         Matrix4x4 matrix = GUI.get_matrix();
         GUI.set_matrix(Matrix4x4.get_identity());
         if (PlayMakerGUI.MouseCursor != null)
         {
             Rect rect = new Rect(Input.get_mousePosition().x - (float)PlayMakerGUI.MouseCursor.get_width() * 0.5f, (float)Screen.get_height() - Input.get_mousePosition().y - (float)PlayMakerGUI.MouseCursor.get_height() * 0.5f, (float)PlayMakerGUI.MouseCursor.get_width(), (float)PlayMakerGUI.MouseCursor.get_height());
             GUI.DrawTexture(rect, PlayMakerGUI.MouseCursor);
         }
         if (this.drawStateLabels && PlayMakerGUI.EnableStateLabels)
         {
             this.DrawStateLabels();
         }
         GUI.set_matrix(matrix);
         PlayMakerGUI.GUIMatrix = Matrix4x4.get_identity();
         if (this.controlMouseCursor)
         {
             Cursor.set_lockState(PlayMakerGUI.LockCursor ? 1 : 0);
             Cursor.set_visible(!PlayMakerGUI.HideCursor);
         }
     }
 }