/// <summary> /// Use only when player "First" play this game or /// "Reset" the game. /// </summary> private void CreateDefaultGameData() { BF_GAME_DATA = new BF_GameData(); BF_GAME_DATA.Name = ""; BF_GAME_DATA.Cash = 1500; // [default: 1500] // save it once SaveGameData(); }
/// <summary> /// Use only when player "First" play this game or /// "Reset" the game. /// </summary> private void CreateDefaultGameData() { GAME_DATA = new BF_GameData(); // Set game data's default values { GAME_DATA.Name = ""; GAME_DATA.Cash = 1500; // [default: 1500] } SaveGameData(); }
private void LoadGameData() { JCS_IO.CreateDirectory(mFullFilePath); // if file does not exist, create the default value file! if (!File.Exists(mFullFilePath + mFullFileName)) { CreateDefaultGameData(); return; } // else we just load the data commonly. BF_GAME_DATA = BF_GameData.LoadFromFile <BF_GameData>(mFullFilePath, mFullFileName); }