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.ViewingState) { _editedState.GetEditableObject()._timeline = _stateEditor.ConvertToTimeline(); } //Update state machine name to reflect filename TimelineStateMachine stateMachine = ConvertToTimelineStateMachine(); stateMachine._name = System.IO.Path.GetFileNameWithoutExtension(_currentFileName); //Save to file SerializeConverter.ToFile(stateMachine, _currentFileName); ClearDirtyFlag(); _stateEditor.ClearDirtyFlag(); GetEditorWindow().DoRepaint(); //Hack, save string on save scene Localisation.SaveStrings(); } else { SaveAs(); } }
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)_editedTimelineState.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(); } else { SaveAs(); } }