private string _fullFileNamePath = ""; //Default set from Start #endregion Fields #region Methods ////////////////////////////////////////// public void LoadGameLevelData() { //Get file name from UI, parse, and set to file setFileName(GameLevelDataNameGen.getName(input_fileName.text)); //Load from XML file GameLevelData = XMLSerialization.Deserialize<C_GameLevelData>(_fullFileNamePath); //Set level name to UI input_levelName.text = GameLevelData.m_levelName; //Pass to game level data to the processor script_gameLevelData = null; script_gameLevelData = GO_GameLevelProcessor.GetComponent<GameLevelProcessor>(); if(script_gameLevelData != null) { script_gameLevelData.gameLevelData = GameLevelData; } }
////////////////////////////////////////// public void LoadGameLevelData() { //Get file name from UI, parse, and set to file setFileName(GameLevelDataNameGen.getName(input_fileName.text)); //Load from XML file GameLevelData = XMLSerialization.Deserialize <C_GameLevelData>(_fullFileNamePath); //Set level name to UI input_levelName.text = GameLevelData.m_levelName; //Pass to game level data to the processor script_gameLevelData = null; script_gameLevelData = GO_GameLevelProcessor.GetComponent <GameLevelProcessor>(); if (script_gameLevelData != null) { script_gameLevelData.gameLevelData = GameLevelData; } }
////////////////////////////////////////// //Get settings, set to GameLevelData, and save public void SaveGameLevelData() { GameLevelData = new C_GameLevelData(); //Pull game level data from the processor script_gameLevelData = null; script_gameLevelData = GO_GameLevelProcessor.GetComponent<GameLevelProcessor>(); if(script_gameLevelData != null) { //Get the settings from the various trigger arrays on the processor object GameLevelData = script_gameLevelData.gameLevelData; //Get Level Name from UI string levelName = input_levelName.text; GameLevelData.m_levelName = levelName; //Get file name from UI, parse, and set to file setFileName(GameLevelDataNameGen.getName(input_fileName.text)); //Save to XML file XMLSerialization.Serialize<C_GameLevelData>(GameLevelData, _fullFileNamePath); } }
////////////////////////////////////////// //Get settings, set to GameLevelData, and save public void SaveGameLevelData() { GameLevelData = new C_GameLevelData(); //Pull game level data from the processor script_gameLevelData = null; script_gameLevelData = GO_GameLevelProcessor.GetComponent <GameLevelProcessor>(); if (script_gameLevelData != null) { //Get the settings from the various trigger arrays on the processor object GameLevelData = script_gameLevelData.gameLevelData; //Get Level Name from UI string levelName = input_levelName.text; GameLevelData.m_levelName = levelName; //Get file name from UI, parse, and set to file setFileName(GameLevelDataNameGen.getName(input_fileName.text)); //Save to XML file XMLSerialization.Serialize <C_GameLevelData>(GameLevelData, _fullFileNamePath); } }