From 2bcc48139d57eeed68c6da80997838ef11c2d55e Mon Sep 17 00:00:00 2001 From: nexovec Date: Sun, 30 Jan 2022 00:05:42 +0100 Subject: [PATCH] Bunch of stuff, working saves --- Assets/Scenes/Vasek.unity | 20 +++++++++++++++++--- Assets/Scripts/UiController.cs | 7 +++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Assets/Scenes/Vasek.unity b/Assets/Scenes/Vasek.unity index 1c0129f..d06bb0b 100644 --- a/Assets/Scenes/Vasek.unity +++ b/Assets/Scenes/Vasek.unity @@ -14,10 +14,10 @@ OcclusionCullingSettings: RenderSettings: m_ObjectHideFlags: 0 serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_Fog: 1 + m_FogColor: {r: 0.084905684, g: 0.084905684, b: 0.084905684, a: 1} m_FogMode: 3 - m_FogDensity: 0.01 + m_FogDensity: 0.022 m_LinearFogStart: 0 m_LinearFogEnd: 300 m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} @@ -303,6 +303,20 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 1258916149, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3} + propertyPath: m_text + value: 'Sonillion + + JonatanRek + + nexovec + + Maartendo 64' + objectReference: {fileID: 0} + - target: {fileID: 1507557244, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3} + propertyPath: m_SizeDelta.y + value: 150 + objectReference: {fileID: 0} - target: {fileID: 3244356566819001085, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3} propertyPath: m_LocalPosition.y value: 1.82 diff --git a/Assets/Scripts/UiController.cs b/Assets/Scripts/UiController.cs index 453db1f..9ab1f59 100644 --- a/Assets/Scripts/UiController.cs +++ b/Assets/Scripts/UiController.cs @@ -25,8 +25,11 @@ public class UiController : MonoBehaviour } public static void SaveGame() { - PlayerPrefs.SetInt("HighestScore", (int)UiController.distance); - PlayerPrefs.Save(); + if (UiController.distance > UiController.highScore) + { + PlayerPrefs.SetInt("HighestScore", (int)UiController.distance); + PlayerPrefs.Save(); + } Debug.Log("Game data saved!"); } static void LoadGame()