1533 lines
28 KiB
C#
1533 lines
28 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Reflection;
|
|
using UFS2.Tokens;
|
|
using UnityEngine;
|
|
|
|
public sealed class SaveDataManager : Singleton<SaveDataManager>
|
|
{
|
|
[Serializable]
|
|
public sealed class SaveSettingsDataClass
|
|
{
|
|
private float mouseSensitivity = 2f;
|
|
|
|
private float cursorSensitivity = 2f;
|
|
|
|
private bool invertMouse;
|
|
|
|
private bool invertMouseX;
|
|
|
|
private bool smoothCamera;
|
|
|
|
private bool controllerVibration = true;
|
|
|
|
private float fov = 50f;
|
|
|
|
private float fogIntesity = 1f;
|
|
|
|
private float floatSize = 1f;
|
|
|
|
private bool fishCursor = true;
|
|
|
|
private bool realisticLineIndicator;
|
|
|
|
private bool lightshaft = true;
|
|
|
|
private bool showChat = true;
|
|
|
|
private int unitWeight;
|
|
|
|
private int unitLenght;
|
|
|
|
private int timeZone;
|
|
|
|
private int temperature;
|
|
|
|
private float mainSoundVolume = 1f;
|
|
|
|
private float ambienVolume = 0.5f;
|
|
|
|
private float fxVolume = 0.5f;
|
|
|
|
private float underwaterVolume = 0.5f;
|
|
|
|
private float uiVolume = 0.5f;
|
|
|
|
private float enviroVolume = 0.5f;
|
|
|
|
private float weatherVolume = 0.5f;
|
|
|
|
private float vehicleVolume = 0.5f;
|
|
|
|
private float waterVolume = 0.5f;
|
|
|
|
private bool residenceMusic = true;
|
|
|
|
private int textureQualityMode;
|
|
|
|
private int waterPlanarIndex;
|
|
|
|
private int waterSSRModeIndex;
|
|
|
|
private int vSync = 1;
|
|
|
|
private bool blurSetting;
|
|
|
|
private float blurUnderwaterSetting = 0.5f;
|
|
|
|
private bool bloomSetting;
|
|
|
|
private bool chromaticAbberation;
|
|
|
|
private int antiAliasing = 3;
|
|
|
|
private bool ambientOccultion = true;
|
|
|
|
private bool waterReflection = true;
|
|
|
|
private float shadowDistance = 500f;
|
|
|
|
[SerializeField]
|
|
public int MaxFpsIndex;
|
|
|
|
private bool backgroundMusic = true;
|
|
|
|
[SerializeField]
|
|
public float MouseSensitivityValue
|
|
{
|
|
get
|
|
{
|
|
return mouseSensitivity;
|
|
}
|
|
set
|
|
{
|
|
mouseSensitivity = Mathf.Clamp(value, 0.1f, 5f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float GamepadCursorSensitivityValue
|
|
{
|
|
get
|
|
{
|
|
return cursorSensitivity;
|
|
}
|
|
set
|
|
{
|
|
cursorSensitivity = Mathf.Clamp(value, 0.1f, 5f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsMouseYInverted
|
|
{
|
|
get
|
|
{
|
|
return invertMouse;
|
|
}
|
|
set
|
|
{
|
|
invertMouse = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsMouseXInverted
|
|
{
|
|
get
|
|
{
|
|
return invertMouseX;
|
|
}
|
|
set
|
|
{
|
|
invertMouseX = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsSmoothCameraEnabled
|
|
{
|
|
get
|
|
{
|
|
return smoothCamera;
|
|
}
|
|
set
|
|
{
|
|
smoothCamera = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsControllerVibrationEnabled
|
|
{
|
|
get
|
|
{
|
|
return controllerVibration;
|
|
}
|
|
set
|
|
{
|
|
controllerVibration = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float FOVValue
|
|
{
|
|
get
|
|
{
|
|
return fov;
|
|
}
|
|
set
|
|
{
|
|
fov = Mathf.Clamp(value, 40f, 90f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float FogIntensityValue
|
|
{
|
|
get
|
|
{
|
|
return fogIntesity;
|
|
}
|
|
set
|
|
{
|
|
fogIntesity = Mathf.Clamp(value, 0f, 1f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float FloatSizeValue
|
|
{
|
|
get
|
|
{
|
|
return floatSize;
|
|
}
|
|
set
|
|
{
|
|
floatSize = Mathf.Clamp(value, 1f, 10f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsFishCursorEnabled
|
|
{
|
|
get
|
|
{
|
|
return fishCursor;
|
|
}
|
|
set
|
|
{
|
|
fishCursor = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsLineIndicatorEnabledOnRealistic
|
|
{
|
|
get
|
|
{
|
|
return realisticLineIndicator;
|
|
}
|
|
set
|
|
{
|
|
realisticLineIndicator = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsLightShaftEnabled
|
|
{
|
|
get
|
|
{
|
|
return lightshaft;
|
|
}
|
|
set
|
|
{
|
|
lightshaft = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsChatEnabled
|
|
{
|
|
get
|
|
{
|
|
return showChat;
|
|
}
|
|
set
|
|
{
|
|
showChat = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int WeightUnitIndex
|
|
{
|
|
get
|
|
{
|
|
return unitWeight;
|
|
}
|
|
set
|
|
{
|
|
unitWeight = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int LengthUnitIndex
|
|
{
|
|
get
|
|
{
|
|
return unitLenght;
|
|
}
|
|
set
|
|
{
|
|
unitLenght = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int TimeConventionIndex
|
|
{
|
|
get
|
|
{
|
|
return timeZone;
|
|
}
|
|
set
|
|
{
|
|
timeZone = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int TemperatureUnitIndex
|
|
{
|
|
get
|
|
{
|
|
return temperature;
|
|
}
|
|
set
|
|
{
|
|
temperature = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float MasterVolume
|
|
{
|
|
get
|
|
{
|
|
return mainSoundVolume;
|
|
}
|
|
set
|
|
{
|
|
mainSoundVolume = Mathf.Clamp(value, 0f, 1f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float MusicVolume
|
|
{
|
|
get
|
|
{
|
|
return ambienVolume;
|
|
}
|
|
set
|
|
{
|
|
ambienVolume = Mathf.Clamp(value, 0f, 1f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float FXVolume
|
|
{
|
|
get
|
|
{
|
|
return fxVolume;
|
|
}
|
|
set
|
|
{
|
|
fxVolume = Mathf.Clamp(value, 0f, 1f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float UnderwaterVolume
|
|
{
|
|
get
|
|
{
|
|
return underwaterVolume;
|
|
}
|
|
set
|
|
{
|
|
underwaterVolume = Mathf.Clamp(value, 0f, 1f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float UIVolume
|
|
{
|
|
get
|
|
{
|
|
return uiVolume;
|
|
}
|
|
set
|
|
{
|
|
uiVolume = Mathf.Clamp(value, 0f, 1f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float EnviroVolume
|
|
{
|
|
get
|
|
{
|
|
return enviroVolume;
|
|
}
|
|
set
|
|
{
|
|
enviroVolume = Mathf.Clamp(value, 0f, 1f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float WeatherVolume
|
|
{
|
|
get
|
|
{
|
|
return weatherVolume;
|
|
}
|
|
set
|
|
{
|
|
weatherVolume = Mathf.Clamp(value, 0f, 1f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float VehicleVolume
|
|
{
|
|
get
|
|
{
|
|
return vehicleVolume;
|
|
}
|
|
set
|
|
{
|
|
vehicleVolume = Mathf.Clamp(value, 0f, 1f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float WaterVolume
|
|
{
|
|
get
|
|
{
|
|
return waterVolume;
|
|
}
|
|
set
|
|
{
|
|
waterVolume = Mathf.Clamp(value, 0f, 1f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsResidenceMusicEnabled
|
|
{
|
|
get
|
|
{
|
|
return residenceMusic;
|
|
}
|
|
set
|
|
{
|
|
residenceMusic = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int TextureQualityModeIndex
|
|
{
|
|
get
|
|
{
|
|
return textureQualityMode;
|
|
}
|
|
set
|
|
{
|
|
textureQualityMode = value;
|
|
}
|
|
}
|
|
|
|
public int WaterPlanarModeIndex
|
|
{
|
|
get
|
|
{
|
|
return waterPlanarIndex;
|
|
}
|
|
set
|
|
{
|
|
waterPlanarIndex = value;
|
|
}
|
|
}
|
|
|
|
public int WaterSSRModeIndex
|
|
{
|
|
get
|
|
{
|
|
return waterSSRModeIndex;
|
|
}
|
|
set
|
|
{
|
|
waterSSRModeIndex = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsVSyncEnabled
|
|
{
|
|
get
|
|
{
|
|
return vSync == 1;
|
|
}
|
|
set
|
|
{
|
|
vSync = (value ? 1 : 0);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsBlurEnabled
|
|
{
|
|
get
|
|
{
|
|
return blurSetting;
|
|
}
|
|
set
|
|
{
|
|
blurSetting = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float BlurUnderwaterSetting
|
|
{
|
|
get
|
|
{
|
|
return blurUnderwaterSetting;
|
|
}
|
|
set
|
|
{
|
|
blurUnderwaterSetting = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsBloomEnabled
|
|
{
|
|
get
|
|
{
|
|
return bloomSetting;
|
|
}
|
|
set
|
|
{
|
|
bloomSetting = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsChromaticAberrationEnabled
|
|
{
|
|
get
|
|
{
|
|
return chromaticAbberation;
|
|
}
|
|
set
|
|
{
|
|
chromaticAbberation = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int AntiAliasingModeIndex
|
|
{
|
|
get
|
|
{
|
|
return antiAliasing;
|
|
}
|
|
set
|
|
{
|
|
antiAliasing = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsAmbientOcclusionEnabled
|
|
{
|
|
get
|
|
{
|
|
return ambientOccultion;
|
|
}
|
|
set
|
|
{
|
|
ambientOccultion = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsWaterReflectionEnabled
|
|
{
|
|
get
|
|
{
|
|
return waterReflection;
|
|
}
|
|
set
|
|
{
|
|
waterReflection = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float ShadowDistanceValue
|
|
{
|
|
get
|
|
{
|
|
return shadowDistance;
|
|
}
|
|
set
|
|
{
|
|
shadowDistance = Mathf.Clamp(value, 0f, 500f);
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsBackgroundMusicEnabled
|
|
{
|
|
get
|
|
{
|
|
return backgroundMusic;
|
|
}
|
|
set
|
|
{
|
|
backgroundMusic = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class SavePlayerDataClass
|
|
{
|
|
private bool tutPopHide;
|
|
|
|
private bool isEnabled;
|
|
|
|
private GameManager.PlayerData.CPlayer.GameMode gameMode;
|
|
|
|
private string playerName = "";
|
|
|
|
private int playerLevel = 1;
|
|
|
|
private float playerExp;
|
|
|
|
private int playerSkillsPoint;
|
|
|
|
private int playerSelectedTree = -1;
|
|
|
|
private float playerMaxExp = 100f;
|
|
|
|
private float playerCash = 200f;
|
|
|
|
private int playerRewards;
|
|
|
|
private int playerFishNetLevel = 1;
|
|
|
|
private int playerFishNetExp;
|
|
|
|
private int playerRankingPoints;
|
|
|
|
private int playerTournamentsWon;
|
|
|
|
private long lastAquariumUpdateTime;
|
|
|
|
private float timeBoostExp;
|
|
|
|
private float timeBoostCash;
|
|
|
|
private int totalFish;
|
|
|
|
private int totalZombiesFish;
|
|
|
|
private int playerSexIndex;
|
|
|
|
private bool toggleFirstStartHelpPanel;
|
|
|
|
private long timerQuest;
|
|
|
|
private long weeklytimerQuest;
|
|
|
|
private long monthlytimerQuest;
|
|
|
|
private int changeQuestCount = 1;
|
|
|
|
private int pointsCap = 200;
|
|
|
|
private int questPoints;
|
|
|
|
private float totalFishWeight;
|
|
|
|
private bool SkillPointAnim = true;
|
|
|
|
private static string Set1Name = "Custom 1";
|
|
|
|
private static string Set2Name = "Custom 2";
|
|
|
|
private static string Set3Name = "Custom 3";
|
|
|
|
private static string Set4Name = "Custom 4";
|
|
|
|
private static string Set5Name = "Custom 5";
|
|
|
|
private List<string> setNames = new List<string> { Set1Name, Set2Name, Set3Name, Set4Name, Set5Name };
|
|
|
|
private int completedDailyQuests;
|
|
|
|
private int completedWeeklyQuests;
|
|
|
|
private int completedMonthlyQuests;
|
|
|
|
private float gameTime;
|
|
|
|
private long lastRentierReward;
|
|
|
|
private List<GameManager.PlayerData.CAccesories> PlayerAccesories;
|
|
|
|
private List<GameManager.PlayerData.CLicences> PlayerLicences;
|
|
|
|
[SerializeField]
|
|
public ChristmasPlayerData ChristmasData = new ChristmasPlayerData();
|
|
|
|
[SerializeField]
|
|
public bool HideTutorialPopUp
|
|
{
|
|
get
|
|
{
|
|
return tutPopHide;
|
|
}
|
|
set
|
|
{
|
|
tutPopHide = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool IsEnabled
|
|
{
|
|
get
|
|
{
|
|
return isEnabled;
|
|
}
|
|
set
|
|
{
|
|
isEnabled = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public GameManager.PlayerData.CPlayer.GameMode GameMode
|
|
{
|
|
get
|
|
{
|
|
return gameMode;
|
|
}
|
|
set
|
|
{
|
|
gameMode = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public string PlayerName
|
|
{
|
|
get
|
|
{
|
|
return playerName;
|
|
}
|
|
set
|
|
{
|
|
playerName = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int PlayerLevel
|
|
{
|
|
get
|
|
{
|
|
return playerLevel;
|
|
}
|
|
set
|
|
{
|
|
playerLevel = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float PlayerExp
|
|
{
|
|
get
|
|
{
|
|
return playerExp;
|
|
}
|
|
set
|
|
{
|
|
playerExp = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int PlayerSkillsPoint
|
|
{
|
|
get
|
|
{
|
|
return playerSkillsPoint;
|
|
}
|
|
set
|
|
{
|
|
playerSkillsPoint = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int PlayerSelectedTree
|
|
{
|
|
get
|
|
{
|
|
return playerSelectedTree;
|
|
}
|
|
set
|
|
{
|
|
playerSelectedTree = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float PlayerMaxExp
|
|
{
|
|
get
|
|
{
|
|
return playerMaxExp;
|
|
}
|
|
set
|
|
{
|
|
playerMaxExp = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float PlayerCash
|
|
{
|
|
get
|
|
{
|
|
return playerCash;
|
|
}
|
|
set
|
|
{
|
|
playerCash = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int PlayerRewards
|
|
{
|
|
get
|
|
{
|
|
return playerRewards;
|
|
}
|
|
set
|
|
{
|
|
playerRewards = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int PlayerFishNetLevel
|
|
{
|
|
get
|
|
{
|
|
return playerFishNetLevel;
|
|
}
|
|
set
|
|
{
|
|
playerFishNetLevel = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int PlayerFishNetExp
|
|
{
|
|
get
|
|
{
|
|
return playerFishNetExp;
|
|
}
|
|
set
|
|
{
|
|
playerFishNetExp = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int PlayerRankingPoints
|
|
{
|
|
get
|
|
{
|
|
return playerRankingPoints;
|
|
}
|
|
set
|
|
{
|
|
playerRankingPoints = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int PlayerTournamentsWon
|
|
{
|
|
get
|
|
{
|
|
return playerTournamentsWon;
|
|
}
|
|
set
|
|
{
|
|
playerTournamentsWon = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public long LastAquariumUpdateTime
|
|
{
|
|
get
|
|
{
|
|
return lastAquariumUpdateTime;
|
|
}
|
|
set
|
|
{
|
|
lastAquariumUpdateTime = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float TimeBoostExp
|
|
{
|
|
get
|
|
{
|
|
return timeBoostExp;
|
|
}
|
|
set
|
|
{
|
|
timeBoostExp = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float TimeBoostCash
|
|
{
|
|
get
|
|
{
|
|
return timeBoostCash;
|
|
}
|
|
set
|
|
{
|
|
timeBoostCash = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int TotalFish
|
|
{
|
|
get
|
|
{
|
|
return totalFish;
|
|
}
|
|
set
|
|
{
|
|
totalFish = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int TotalZombiesFish
|
|
{
|
|
get
|
|
{
|
|
return totalZombiesFish;
|
|
}
|
|
set
|
|
{
|
|
totalZombiesFish = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int PlayerSexIndex
|
|
{
|
|
get
|
|
{
|
|
return playerSexIndex;
|
|
}
|
|
set
|
|
{
|
|
playerSexIndex = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool HideStartHelpPanel
|
|
{
|
|
get
|
|
{
|
|
return toggleFirstStartHelpPanel;
|
|
}
|
|
set
|
|
{
|
|
toggleFirstStartHelpPanel = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public long TimerQuest
|
|
{
|
|
get
|
|
{
|
|
return timerQuest;
|
|
}
|
|
set
|
|
{
|
|
timerQuest = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public long WeeklyTimerQuest
|
|
{
|
|
get
|
|
{
|
|
return weeklytimerQuest;
|
|
}
|
|
set
|
|
{
|
|
weeklytimerQuest = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public long MonthlyTimerQuest
|
|
{
|
|
get
|
|
{
|
|
return monthlytimerQuest;
|
|
}
|
|
set
|
|
{
|
|
monthlytimerQuest = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int AmountOfQuestChangesAvailable
|
|
{
|
|
get
|
|
{
|
|
return changeQuestCount;
|
|
}
|
|
set
|
|
{
|
|
changeQuestCount = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int PointsCap
|
|
{
|
|
get
|
|
{
|
|
return pointsCap;
|
|
}
|
|
set
|
|
{
|
|
pointsCap = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int QuestPoints
|
|
{
|
|
get
|
|
{
|
|
return questPoints;
|
|
}
|
|
set
|
|
{
|
|
questPoints = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float TotalFishWeight
|
|
{
|
|
get
|
|
{
|
|
return totalFishWeight;
|
|
}
|
|
set
|
|
{
|
|
totalFishWeight = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public bool ShowSkillsAnimation
|
|
{
|
|
get
|
|
{
|
|
return SkillPointAnim;
|
|
}
|
|
set
|
|
{
|
|
SkillPointAnim = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public List<string> SetNames
|
|
{
|
|
get
|
|
{
|
|
return setNames;
|
|
}
|
|
set
|
|
{
|
|
setNames = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int CompletedDailyQuests
|
|
{
|
|
get
|
|
{
|
|
return completedDailyQuests;
|
|
}
|
|
set
|
|
{
|
|
completedDailyQuests = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int CompletedWeeklyQuests
|
|
{
|
|
get
|
|
{
|
|
return completedWeeklyQuests;
|
|
}
|
|
set
|
|
{
|
|
completedWeeklyQuests = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public int CompletedMonthlyQuests
|
|
{
|
|
get
|
|
{
|
|
return completedMonthlyQuests;
|
|
}
|
|
set
|
|
{
|
|
completedMonthlyQuests = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public float GameTime
|
|
{
|
|
get
|
|
{
|
|
return gameTime;
|
|
}
|
|
set
|
|
{
|
|
gameTime = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public long LastRentierRewardTime
|
|
{
|
|
get
|
|
{
|
|
return lastRentierReward;
|
|
}
|
|
set
|
|
{
|
|
lastRentierReward = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CRods> PlayerRods { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CReels> PlayerReels { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CLines> PlayerLines { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CLeaders> PlayerLeaders { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CBaits> PlayerBaits { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CHooks> PlayerHooks { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CFloats> PlayerFloats { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CFeeders> PlayerFeeders { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CWeights> PlayerWeights { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CAccesories> PlayerAccessories
|
|
{
|
|
get
|
|
{
|
|
return PlayerAccesories;
|
|
}
|
|
set
|
|
{
|
|
PlayerAccesories = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CGroundbaits> PlayerGroundbaits { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CSlots> PlayerSlotsEquip { get; set; }
|
|
|
|
[SerializeField]
|
|
public GameManager.PlayerData.CBasket PlayerShopBasket { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CFishNet> PlayerFishNet { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CAquarium> PlayerAquarium { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CTrophy> PlayerTrophy { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CQuest> PlayerQuest { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CQuest> PlayerWeeklyQuest { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CQuest> PlayerMonthlyQuest { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CSkills> PlayerSkills { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CPersonalRecords> PlayerPersonalRecords { get; set; }
|
|
|
|
[SerializeField]
|
|
public List<GameManager.PlayerData.CLicences> PlayerLicenses
|
|
{
|
|
get
|
|
{
|
|
return PlayerLicences;
|
|
}
|
|
set
|
|
{
|
|
PlayerLicences = value;
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public List<BoostToken> PlayerBoostTokens { get; set; }
|
|
|
|
public SavePlayerDataClass()
|
|
{
|
|
PlayerRods = new List<GameManager.PlayerData.CRods>();
|
|
PlayerReels = new List<GameManager.PlayerData.CReels>();
|
|
PlayerLines = new List<GameManager.PlayerData.CLines>();
|
|
PlayerLeaders = new List<GameManager.PlayerData.CLeaders>();
|
|
PlayerBaits = new List<GameManager.PlayerData.CBaits>();
|
|
PlayerHooks = new List<GameManager.PlayerData.CHooks>();
|
|
PlayerFloats = new List<GameManager.PlayerData.CFloats>();
|
|
PlayerFeeders = new List<GameManager.PlayerData.CFeeders>();
|
|
PlayerWeights = new List<GameManager.PlayerData.CWeights>();
|
|
PlayerAccessories = new List<GameManager.PlayerData.CAccesories>();
|
|
PlayerGroundbaits = new List<GameManager.PlayerData.CGroundbaits>();
|
|
PlayerSlotsEquip = new List<GameManager.PlayerData.CSlots>(GameManager.Instance._playerData.PlayerSlotsEquipTemplate);
|
|
PlayerShopBasket = new GameManager.PlayerData.CBasket();
|
|
PlayerFishNet = new List<GameManager.PlayerData.CFishNet>();
|
|
PlayerAquarium = new List<GameManager.PlayerData.CAquarium>
|
|
{
|
|
new GameManager.PlayerData.CAquarium(),
|
|
new GameManager.PlayerData.CAquarium(),
|
|
new GameManager.PlayerData.CAquarium(),
|
|
new GameManager.PlayerData.CAquarium()
|
|
};
|
|
PlayerTrophy = new List<GameManager.PlayerData.CTrophy>();
|
|
PlayerQuest = new List<GameManager.PlayerData.CQuest>();
|
|
PlayerWeeklyQuest = new List<GameManager.PlayerData.CQuest>();
|
|
PlayerMonthlyQuest = new List<GameManager.PlayerData.CQuest>();
|
|
PlayerSkills = new List<GameManager.PlayerData.CSkills>();
|
|
PlayerPersonalRecords = new List<GameManager.PlayerData.CPersonalRecords>();
|
|
PlayerLicenses = new List<GameManager.PlayerData.CLicences>();
|
|
PlayerBoostTokens = GameManager.Instance._playerData.PlayerBoostTokens;
|
|
}
|
|
}
|
|
|
|
public SaveSettingsDataClass SettingsData = new SaveSettingsDataClass();
|
|
|
|
public List<SavePlayerDataClass> PlayerData = new List<SavePlayerDataClass>();
|
|
|
|
public const float MinMouseSensitivityValue = 0.1f;
|
|
|
|
public const float MaxMouseSensitivityValue = 5f;
|
|
|
|
public const float MinGamepadCursorSensitivityValue = 0.1f;
|
|
|
|
public const float MaxGamepadCursorSensitivityValue = 5f;
|
|
|
|
public const float MinFOVValue = 40f;
|
|
|
|
public const float MaxFOVValue = 90f;
|
|
|
|
public const float MinFogIntensityValue = 0f;
|
|
|
|
public const float MaxFogIntensityValue = 1f;
|
|
|
|
public const float MinFloatSizeValue = 1f;
|
|
|
|
public const float MaxFloatSizeValue = 10f;
|
|
|
|
public const float MinMasterVolume = 0f;
|
|
|
|
public const float MaxMasterVolume = 1f;
|
|
|
|
public const float MinMusicVolume = 0f;
|
|
|
|
public const float MaxMusicVolume = 1f;
|
|
|
|
public const float MinFXVolume = 0f;
|
|
|
|
public const float MaxFXVolume = 1f;
|
|
|
|
public const float MinUnderwaterVolume = 0f;
|
|
|
|
public const float MaxUnderwaterVolume = 1f;
|
|
|
|
public const float MinUIVolume = 0f;
|
|
|
|
public const float MaxUIVolume = 1f;
|
|
|
|
public const float MinEnviroVolume = 0f;
|
|
|
|
public const float MaxEnviroVolume = 1f;
|
|
|
|
public const float MinWeatherVolume = 0f;
|
|
|
|
public const float MaxWeatherVolume = 1f;
|
|
|
|
public const float MinVehicleVolume = 0f;
|
|
|
|
public const float MaxVehicleVolume = 1f;
|
|
|
|
public const float MinWaterVolume = 0f;
|
|
|
|
public const float MaxWaterVolume = 1f;
|
|
|
|
public const float MinShadowDistanceValue = 0f;
|
|
|
|
public const float MaxShadowDistanceValue = 500f;
|
|
|
|
public SavePlayerDataClass GetCurrentPlayerData()
|
|
{
|
|
int currentPlayerProfileIndex = GameManager.Instance._playerData.currentPlayerProfileIndex;
|
|
if (currentPlayerProfileIndex < 0 || currentPlayerProfileIndex >= PlayerData.Count)
|
|
{
|
|
UnityEngine.Debug.LogError($"Invalid index of player data! [Index = {currentPlayerProfileIndex}]");
|
|
}
|
|
return PlayerData[currentPlayerProfileIndex];
|
|
}
|
|
|
|
public SavePlayerDataClass GetSpecifiedPlayerData(int index)
|
|
{
|
|
if (index < 0 || index >= PlayerData.Count)
|
|
{
|
|
UnityEngine.Debug.LogError("Invalid index of player data!");
|
|
}
|
|
return PlayerData[index];
|
|
}
|
|
|
|
public void ResetSpecifiedPlayerData(int index)
|
|
{
|
|
PlayerData[index] = new SavePlayerDataClass();
|
|
}
|
|
|
|
public void ResetSettingsData()
|
|
{
|
|
SettingsData = new SaveSettingsDataClass();
|
|
}
|
|
|
|
public void CreatePlayerData()
|
|
{
|
|
PlayerData.Add(new SavePlayerDataClass());
|
|
PlayerData.Add(new SavePlayerDataClass());
|
|
PlayerData.Add(new SavePlayerDataClass());
|
|
}
|
|
|
|
public void LoadSettingsDataFromGameManager()
|
|
{
|
|
UnityEngine.Debug.Log("LoadSettingsDataFromGameManager");
|
|
GameManager.PlayerData.CPlayer obj = GameManager.Instance._playerData.Player[0];
|
|
FieldInfo[] fields = typeof(SaveSettingsDataClass).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
|
foreach (FieldInfo fieldInfo in fields)
|
|
{
|
|
FieldInfo field = typeof(GameManager.PlayerData.CPlayer).GetField(fieldInfo.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
|
if (field != null)
|
|
{
|
|
fieldInfo.SetValue(SettingsData, field.GetValue(obj));
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadPlayerDataFromSPrefs()
|
|
{
|
|
UnityEngine.Debug.Log("LoadPlayerDataFromSPrefs");
|
|
int currentPlayerProfileIndex = GameManager.Instance._playerData.currentPlayerProfileIndex;
|
|
FieldInfo[] fields = typeof(SavePlayerDataClass).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
|
for (int i = 0; i < GameManager.Instance._playerData.Player.Count; i++)
|
|
{
|
|
GameManager.PlayerData.CPlayer obj = GameManager.Instance._playerData.Player[i];
|
|
FieldInfo[] array = fields;
|
|
foreach (FieldInfo fieldInfo in array)
|
|
{
|
|
FieldInfo field = typeof(GameManager.PlayerData.CPlayer).GetField(fieldInfo.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
|
if (field != null)
|
|
{
|
|
fieldInfo.SetValue(PlayerData[i], field.GetValue(obj));
|
|
}
|
|
}
|
|
GameManager.Instance._playerData.currentPlayerProfileIndex = i;
|
|
GameManager.Instance._playerData.LoadAllPlayerData();
|
|
PlayerData[i].SetNames = new List<string>
|
|
{
|
|
GameManager.Instance._playerData.Player[i].Set1Name,
|
|
GameManager.Instance._playerData.Player[i].Set2Name,
|
|
GameManager.Instance._playerData.Player[i].Set3Name,
|
|
GameManager.Instance._playerData.Player[i].Set4Name,
|
|
GameManager.Instance._playerData.Player[i].Set5Name
|
|
};
|
|
PlayerData[i].PlayerRods = new List<GameManager.PlayerData.CRods>(GameManager.Instance._playerData.PlayerRods);
|
|
PlayerData[i].PlayerReels = new List<GameManager.PlayerData.CReels>(GameManager.Instance._playerData.PlayerReels);
|
|
PlayerData[i].PlayerLines = new List<GameManager.PlayerData.CLines>(GameManager.Instance._playerData.PlayerLines);
|
|
PlayerData[i].PlayerLeaders = new List<GameManager.PlayerData.CLeaders>(GameManager.Instance._playerData.PlayerLeaders);
|
|
PlayerData[i].PlayerBaits = new List<GameManager.PlayerData.CBaits>(GameManager.Instance._playerData.PlayerBaits);
|
|
PlayerData[i].PlayerHooks = new List<GameManager.PlayerData.CHooks>(GameManager.Instance._playerData.PlayerHooks);
|
|
PlayerData[i].PlayerFloats = new List<GameManager.PlayerData.CFloats>(GameManager.Instance._playerData.PlayerFloats);
|
|
PlayerData[i].PlayerFeeders = new List<GameManager.PlayerData.CFeeders>(GameManager.Instance._playerData.PlayerFeeders);
|
|
PlayerData[i].PlayerWeights = new List<GameManager.PlayerData.CWeights>(GameManager.Instance._playerData.PlayerWeights);
|
|
PlayerData[i].PlayerAccessories = new List<GameManager.PlayerData.CAccesories>(GameManager.Instance._playerData.PlayerAccesories);
|
|
PlayerData[i].PlayerGroundbaits = new List<GameManager.PlayerData.CGroundbaits>(GameManager.Instance._playerData.PlayerGroundbaits);
|
|
PlayerData[i].PlayerSlotsEquip = new List<GameManager.PlayerData.CSlots>(GameManager.Instance._playerData.PlayerSlotsEquip);
|
|
PlayerData[i].PlayerShopBasket = new GameManager.PlayerData.CBasket();
|
|
PlayerData[i].PlayerFishNet = new List<GameManager.PlayerData.CFishNet>(GameManager.Instance._playerData.PlayerFishNet);
|
|
PlayerData[i].PlayerAquarium = new List<GameManager.PlayerData.CAquarium>(GameManager.Instance._playerData.PlayerAquarium);
|
|
PlayerData[i].PlayerTrophy = new List<GameManager.PlayerData.CTrophy>(GameManager.Instance._playerData.PlayerTrophy);
|
|
PlayerData[i].PlayerQuest = new List<GameManager.PlayerData.CQuest>(GameManager.Instance._playerData.PlayerQuest);
|
|
PlayerData[i].PlayerWeeklyQuest = new List<GameManager.PlayerData.CQuest>(GameManager.Instance._playerData.PlayerWeeklyQuest);
|
|
PlayerData[i].PlayerMonthlyQuest = new List<GameManager.PlayerData.CQuest>(GameManager.Instance._playerData.PlayerMonthlyQuest);
|
|
PlayerData[i].PlayerSkills = new List<GameManager.PlayerData.CSkills>(GameManager.Instance._playerData.PlayerSkills);
|
|
PlayerData[i].PlayerPersonalRecords = new List<GameManager.PlayerData.CPersonalRecords>(GameManager.Instance._playerData.PlayerPersonalRecords);
|
|
PlayerData[i].PlayerLicenses = new List<GameManager.PlayerData.CLicences>(GameManager.Instance._playerData.PlayerLicences);
|
|
PlayerData[i].PlayerBoostTokens = new List<BoostToken>(GameManager.Instance._playerData.PlayerBoostTokens);
|
|
}
|
|
GameManager.Instance._playerData.currentPlayerProfileIndex = currentPlayerProfileIndex;
|
|
if (File.Exists(Application.dataPath + "//UFS2_Saves_Backup_fix.bat"))
|
|
{
|
|
EasySaveSystemManager.WriteSaveLog("Backup bat start.");
|
|
Process.Start(Application.dataPath + "//UFS2_Saves_Backup_fix.bat");
|
|
}
|
|
else
|
|
{
|
|
EasySaveSystemManager.WriteSaveError("Backup bat not found!");
|
|
}
|
|
foreach (SavePlayerDataClass playerDatum in PlayerData)
|
|
{
|
|
UnityEngine.Debug.Log("Data after loading from Prefs: " + playerDatum.PlayerName);
|
|
}
|
|
}
|
|
|
|
public bool IsCurrentlySandbox()
|
|
{
|
|
return GetCurrentPlayerData().GameMode == GameManager.PlayerData.CPlayer.GameMode.Sandbox;
|
|
}
|
|
|
|
public bool HasCurrentPlayerSkill(GameManager.Skills skill)
|
|
{
|
|
for (int i = 0; i < GetCurrentPlayerData().PlayerSkills.Count; i++)
|
|
{
|
|
if (GetCurrentPlayerData().PlayerSkills[i].skill == skill)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public void ResetRodStatuses()
|
|
{
|
|
if (GetCurrentPlayerData().PlayerRods == null)
|
|
{
|
|
UnityEngine.Debug.LogError("PlayerRods is null!");
|
|
return;
|
|
}
|
|
if (GameManager.Instance._playerData.currentPlayerProfileIndex < 0)
|
|
{
|
|
UnityEngine.Debug.LogError("Current player data is null!");
|
|
return;
|
|
}
|
|
if (GetCurrentPlayerData().PlayerSlotsEquip == null)
|
|
{
|
|
UnityEngine.Debug.LogError("PlayerSlotsEquip is null!");
|
|
return;
|
|
}
|
|
for (int i = 0; i < GetCurrentPlayerData().PlayerRods.Count; i++)
|
|
{
|
|
GetCurrentPlayerData().PlayerRods[i].status = GameManager.PlayerData.CRods.Status.InEquip;
|
|
}
|
|
for (int j = 0; j < GetCurrentPlayerData().PlayerSlotsEquip.Count; j++)
|
|
{
|
|
GetCurrentPlayerData().PlayerSlotsEquip[j].rod.status = GameManager.PlayerData.CRods.Status.InEquip;
|
|
}
|
|
}
|
|
|
|
public void ResetPlayerBaskets()
|
|
{
|
|
for (int i = 0; i < PlayerData.Count; i++)
|
|
{
|
|
PlayerData[i].PlayerShopBasket = new GameManager.PlayerData.CBasket();
|
|
}
|
|
}
|
|
}
|