public static void SetSaveData(SaveData saveData) { StaticSettings.GameProgress = saveData.GameProgress; StaticSettings.checkpointID = saveData.CheckpointID; StaticSettings.credits = saveData.credits; StarshipsModificatonsData.SetStarshipsData(saveData.currentStarshipsModificationsGrade); }
public static void ReInitialize() { checkpointID = 0; credits = 50; GameProgress = 0; isRestart = false; isCompleteSomething = false; StarshipsModificatonsData.ResetStarshipDatas(); }
public static SaveData GetCurrentDataToSave() { SaveData saveData = new SaveData(); saveData.GameProgress = StaticSettings.GameProgress; saveData.CheckpointID = StaticSettings.checkpointID; saveData.credits = StaticSettings.credits; saveData.currentStarshipsModificationsGrade = StarshipsModificatonsData.GetStarshipsDataForSave(); saveData.saveDateTime = DateTime.Now; return(saveData); }
public void Initialize(GameObject StarshipPrefab) { Health health = StarshipPrefab.GetComponent <Health>(); Starship_Engine starship_Engine = StarshipPrefab.GetComponent <Starship_Engine>(); Starship_RotationEngine starship_RotationEngine = StarshipPrefab.GetComponent <Starship_RotationEngine>(); Guns guns = StarshipPrefab.GetComponent <Guns>(); StarshipData starshipData = StarshipsModificatonsData.GetStarshipData(StarshipPrefab.GetComponent <PlayerStarshipModifications>().Starship); InitializeModificationMenu(ModificationMenus[0], health.maxHp, starshipData, ModificationName.Health); InitializeModificationMenu(ModificationMenus[1], starship_Engine.force, starshipData, ModificationName.EnginePower); InitializeModificationMenu(ModificationMenus[2], starship_RotationEngine.force, starshipData, ModificationName.GyroPower); InitializeModificationMenu(ModificationMenus[3], 1 / guns.ShootTime, starshipData, ModificationName.ShootTime); }