public static AIEditorPropertiesSave Load(string fileName)
        {
            AIEditorPropertiesSave toReturn = new AIEditorPropertiesSave();

            FileManager.XmlDeserialize(fileName, out toReturn);

            return toReturn;
        }
        public static AIEditorPropertiesSave Load(string fileName)
        {
            AIEditorPropertiesSave toReturn = new AIEditorPropertiesSave();

            FileManager.XmlDeserialize(fileName, out toReturn);

            return(toReturn);
        }
예제 #3
0
        void SaveNodeNetworkSettingsOk(Window callingWindow)
        {
            FlatRedBall.Content.AI.Pathfinding.NodeNetworkSave nodeNetworkSave =
                FlatRedBall.Content.AI.Pathfinding.NodeNetworkSave.FromNodeNetwork(EditorData.NodeNetwork);

            AxisFlippingSettings axisFlippingSettings =
                ((PropertyGrid<AxisFlippingSettings>)callingWindow.Parent).SelectedObject;


            if (axisFlippingSettings.FlipY)
            {

                foreach (PositionedNodeSave pns in nodeNetworkSave.PositionedNodes)
                {
                    pns.Y = -pns.Y;
                }
            }

            if (axisFlippingSettings.CopyYToZ)
            {
                foreach (PositionedNodeSave pns in nodeNetworkSave.PositionedNodes)
                {
                    pns.Z = pns.Y;
                }
            }

            if (axisFlippingSettings.MakeYZero)
            {
                foreach (PositionedNodeSave pns in nodeNetworkSave.PositionedNodes)
                {
                    pns.Y = 0;
                }
            }

            string companionFile = FileManager.RemoveExtension(mNameOfNodeNetwork) + "." + AIEditorPropertiesSave.Extension;

            AIEditorPropertiesSave aieps = new AIEditorPropertiesSave();
            aieps.SetFromRuntime(SpriteManager.Camera, null, false);
            aieps.Save(companionFile);
            nodeNetworkSave.Save(mNameOfNodeNetwork);
            if (!System.IO.File.Exists(mNameOfNodeNetwork))
            {
                GuiManager.ShowMessageBox("Error saving file " + mNameOfNodeNetwork, "Error saving");
            }
        }