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();
                    }
                }
Example #2
0
            public static void SaveStrings()
            {
                if (_localisationMap != null)
                {
                    string path;

                    TextAsset asset = Resources.Load(kDefaultLocalisationFilePath) as TextAsset;
                    if (asset != null)
                    {
                        path = AssetDatabase.GetAssetPath(asset);
                    }
                    else
                    {
                        path = Application.dataPath + "/Resources/" + kDefaultLocalisationFilePath + ".xml";
                    }

                    SerializeConverter.ToFile(_localisationMap, path);
                }
            }
Example #3
0
                public void Save()
                {
                    if (!string.IsNullOrEmpty(_currentFileName))
                    {
                        //Save to file
                        NodeGraph nodeGraph = ConvertToNodeGraph();
                        SerializeConverter.ToFile(nodeGraph, _currentFileName);

                        ClearDirtyFlag();

                        foreach (NodeEditorGUI node in _editableObjects)
                        {
                            node.MarkAsDirty(false);
                        }

                        GetEditorWindow().DoRepaint();
                    }
                    else
                    {
                        SaveAs();
                    }
                }