From e0c6c978f9f4ad3441412892f588e70b8552058e Mon Sep 17 00:00:00 2001 From: ptaillandier Date: Mon, 8 Apr 2024 17:38:44 +0700 Subject: [PATCH] fixes an issue with loading menus and time initial value --- .../LiberationSans SDF - Fallback.asset | 23 +++++++++++++++---- Assets/Plugins/PlayMaker/PlayMaker.sln.meta | 7 ++++++ Assets/Scenes/StartupMenu.unity | 4 ++-- Assets/Scripts/MenuController.cs | 2 ++ Assets/Scripts/Utils/ExceptionWatcher.cs.meta | 11 --------- Assets/Scripts/Utils/ManageSceneLoading.cs | 4 +++- Assets/Scripts/Utils/Timer.cs | 2 +- 7 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 Assets/Plugins/PlayMaker/PlayMaker.sln.meta delete mode 100644 Assets/Scripts/Utils/ExceptionWatcher.cs.meta diff --git a/Assets/PACKAGES/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset b/Assets/PACKAGES/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset index e907cc73..449bd2d9 100644 --- a/Assets/PACKAGES/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset +++ b/Assets/PACKAGES/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset @@ -2,20 +2,24 @@ %TAG !u! tag:unity3d.com,2011: --- !u!21 &2180264 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: LiberationSans SDF Material m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 1 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -67,6 +71,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _Ambient: 0.5 - _Bevel: 0.5 @@ -148,6 +153,7 @@ Material: - _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1} - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} - _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5} + m_BuildTextureStacks: [] --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -165,15 +171,16 @@ MonoBehaviour: materialHashCode: 462855346 m_Version: 1.1.0 m_SourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75 - m_SourceFontFile_EditorRef: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, - type: 3} + m_SourceFontFile_EditorRef: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3} m_SourceFontFile: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3} m_AtlasPopulationMode: 1 m_FaceInfo: + m_FaceIndex: 0 m_FamilyName: Liberation Sans m_StyleName: Regular m_PointSize: 86 m_Scale: 1 + m_UnitsPerEM: 0 m_LineHeight: 98.8916 m_AscentLine: 77.853516 m_CapLine: 59 @@ -313,15 +320,21 @@ Texture2D: Hash: 00000000000000000000000000000000 m_ForcedFallbackFormat: 4 m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 serializedVersion: 2 m_Width: 0 m_Height: 0 m_CompleteImageSize: 0 + m_MipsStripped: 0 m_TextureFormat: 1 m_MipCount: 1 m_IsReadable: 1 + m_IsPreProcessed: 0 + m_IgnoreMipmapLimit: 0 + m_MipmapLimitGroupName: m_StreamingMipmaps: 0 m_StreamingMipmapsPriority: 0 + m_VTOnly: 0 m_AlphaIsTransparency: 0 m_ImageCount: 1 m_TextureDimension: 2 @@ -335,9 +348,11 @@ Texture2D: m_WrapW: 0 m_LightmapFormat: 0 m_ColorSpace: 0 + m_PlatformBlob: image data: 0 _typelessdata: m_StreamData: + serializedVersion: 2 offset: 0 size: 0 path: diff --git a/Assets/Plugins/PlayMaker/PlayMaker.sln.meta b/Assets/Plugins/PlayMaker/PlayMaker.sln.meta new file mode 100644 index 00000000..d03610a4 --- /dev/null +++ b/Assets/Plugins/PlayMaker/PlayMaker.sln.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: de81effaacf3f466383302ae53227ac4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/StartupMenu.unity b/Assets/Scenes/StartupMenu.unity index c866f84f..ad800120 100644 --- a/Assets/Scenes/StartupMenu.unity +++ b/Assets/Scenes/StartupMenu.unity @@ -1631,7 +1631,7 @@ RectTransform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1649425397} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 3} m_LocalScale: {x: 0.002, y: 0.002, z: 0.002} m_ConstrainProportionsScale: 0 m_Children: @@ -1641,7 +1641,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: -0.08, y: 1.1} + m_AnchoredPosition: {x: -0.08, y: 1.2} m_SizeDelta: {x: 830, y: 600} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1649425399 diff --git a/Assets/Scripts/MenuController.cs b/Assets/Scripts/MenuController.cs index c489d6d9..b3d17767 100644 --- a/Assets/Scripts/MenuController.cs +++ b/Assets/Scripts/MenuController.cs @@ -16,6 +16,8 @@ public void Start() //Adds a listener to the main slider and invokes a method when the value changes. mainSlider.onValueChanged.AddListener(delegate { ValueChangeCheck(); }); gameDurationText.SetText("Game duration: " + mainSlider.value + "s"); + PlayerPrefs.SetFloat("duration", mainSlider.value); + } // Invoked when the value of the slider changes. diff --git a/Assets/Scripts/Utils/ExceptionWatcher.cs.meta b/Assets/Scripts/Utils/ExceptionWatcher.cs.meta deleted file mode 100644 index b9aa76c4..00000000 --- a/Assets/Scripts/Utils/ExceptionWatcher.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f89f6138760fd422888826f46973d430 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Utils/ManageSceneLoading.cs b/Assets/Scripts/Utils/ManageSceneLoading.cs index 00b2a5ca..f72b8437 100644 --- a/Assets/Scripts/Utils/ManageSceneLoading.cs +++ b/Assets/Scripts/Utils/ManageSceneLoading.cs @@ -25,11 +25,13 @@ public void LoadScene(string scene) IEnumerator loadASync(string scene) { - AsyncOperation operation = SceneManager.LoadSceneAsync(scene); toDisable.SetActive(false); loadingScreen.SetActive(true); + AsyncOperation operation = SceneManager.LoadSceneAsync(scene); + + while (!operation.isDone) { float progress = Mathf.Clamp01(operation.progress / 0.9f); diff --git a/Assets/Scripts/Utils/Timer.cs b/Assets/Scripts/Utils/Timer.cs index b5311a8d..14aec5b4 100644 --- a/Assets/Scripts/Utils/Timer.cs +++ b/Assets/Scripts/Utils/Timer.cs @@ -21,7 +21,7 @@ public class Timer : MonoBehaviour // ############################################################ void Start() { - timerDuration = PlayerPrefs.GetFloat("duration"); + timerDuration = PlayerPrefs.GetFloat("duration"); timeRemaining = timerDuration; midTime = timeRemaining / 2; DisplayTime(timeRemaining-1);