protected override State CreateCopyFrom(SerializedObjectEditorGUI <State> editorGUI)
                {
                    StateEditorGUI timeLineGUI = (StateEditorGUI)editorGUI;
                    State          newState    = Serializer.CreateCopy(timeLineGUI.GetEditableObject());

                    newState._editorDescription = timeLineGUI.GetStateDescription() + " (Copy)";
                    newState._stateId           = GenerateNewStateId();

                    return(newState);
                }
                private void RenderToolBar(Vector2 windowSize)
                {
                    EditorGUILayout.BeginVertical();
                    {
                        EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
                        {
                            string titleText = _title + " - <b>" + System.IO.Path.GetFileName(_currentFileName);

                            if (HasChanges() || _timelineEditor.HasChanges())
                            {
                                titleText += "*";
                            }

                            titleText += "</b>";

                            EditorGUILayout.LabelField(titleText, _style._titleStyle);
                        }
                        EditorGUILayout.EndHorizontal();

                        EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
                        {
                            if (GUILayout.Button("New", EditorStyles.toolbarButton))
                            {
                                if (ShowOnLoadSaveChangesDialog())
                                {
                                    New();
                                }
                            }

                            if (GUILayout.Button("Load", EditorStyles.toolbarButton))
                            {
                                if (ShowOnLoadSaveChangesDialog())
                                {
                                    string fileName = EditorUtility.OpenFilePanel("Open File", Application.dataPath + "/gamedata", "xml");
                                    if (fileName != null && fileName != string.Empty)
                                    {
                                        LoadFile(fileName);
                                    }
                                }
                            }

                            if (GUILayout.Button("Save", EditorStyles.toolbarButton))
                            {
                                Save();
                            }

                            if (GUILayout.Button("Save As", EditorStyles.toolbarButton))
                            {
                                SaveAs();
                            }

                            EditorGUILayout.Space();

                            _editorPrefs._debug = GUILayout.Toggle(_editorPrefs._debug, "Debug StateMachine", EditorStyles.toolbarButton);

                            StateMachineComponent currentDbugObject = _editorPrefs._debugObject.GetComponent();
                            StateMachineComponent debugObject       = (StateMachineComponent)EditorGUILayout.ObjectField(currentDbugObject, typeof(StateMachineComponent), true);

                            if (currentDbugObject != debugObject)
                            {
                                _editorPrefs._debugObject = new ComponentRef <StateMachineComponent>(GameObjectRef.eSourceType.Scene, debugObject);

                                if (debugObject != null && _editorPrefs._debugObject.GetComponent() == null)
                                {
                                    _editorPrefs._debugObject = new ComponentRef <StateMachineComponent>(GameObjectRef.eSourceType.Prefab, debugObject);
                                }

                                SaveEditorPrefs();
                            }

                            _editorPrefs._debugLockFocus = GUILayout.Toggle(_editorPrefs._debugLockFocus, "Lock Focus", EditorStyles.toolbarButton);

                            GUILayout.FlexibleSpace();
                        }
                        EditorGUILayout.EndHorizontal();

                        EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
                        {
                            if (_currentMode == eMode.ViewingTimelineState)
                            {
                                if (GUILayout.Button("Back", EditorStyles.toolbarButton))
                                {
                                    SwitchToStatemachineView();
                                }
                                else
                                {
                                    EditorGUILayout.Space();

                                    string stateText = "state" + ((int)(_editedState.GetStateId())).ToString("000") + " - <b>" + StringUtils.GetFirstLine(_editedState.GetStateDescription()) + "</b>";
                                    GUILayout.Toggle(true, stateText, _style._toolbarStyle);

                                    GUILayout.FlexibleSpace();
                                }
                            }
                            else
                            {
                                GUILayout.Button("Zoom", EditorStyles.toolbarButton);

                                float zoom = EditorGUILayout.Slider(_currentZoom, 0.5f, 1.5f);

                                if (GUILayout.Button("Reset Zoom", EditorStyles.toolbarButton))
                                {
                                    zoom = 1.0f;
                                }

                                if (_currentZoom != zoom)
                                {
                                    _currentZoom = zoom;

                                    _editorPrefs._zoom = _currentZoom;
                                    SaveEditorPrefs();
                                }

                                if (GUILayout.Button("Center", EditorStyles.toolbarButton))
                                {
                                    CenterCamera();
                                }
                                GUILayout.FlexibleSpace();
                            }
                        }

                        EditorGUILayout.EndHorizontal();
                    }
                    EditorGUILayout.EndVertical();
                }