public void Save() { if (!string.IsNullOrEmpty(_currentFileName)) { //If we're in state view first need to apply state changes to state machine view if (_currentMode == eMode.ViewingTimelineState) { ((TimelineState)_editedState.GetEditableObject())._timeline = _timelineEditor.ConvertToTimeline(); } //Update state machine name to reflect filename StateMachine stateMachine = ConvertToStateMachine(); //Save to file Serializer.ToFile(stateMachine, _currentFileName); ClearDirtyFlag(); _timelineEditor.ClearDirtyFlag(); GetEditorWindow().DoRepaint(); //Hack, save string on save scene Localisation.SaveStrings(); } else { SaveAs(); } }