From b3f749914b5944d2b0a4181e5e068a43ff66abf5 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Fri, 30 Jan 2026 22:23:46 -0700 Subject: [PATCH] Fix loading --- Assets/Scenes/LoadingMenu.unity | 45 ++++++++++++++++++++++++++++++++ Assets/Scripts/BazookaManager.cs | 29 ++++++++++---------- 2 files changed, 59 insertions(+), 15 deletions(-) diff --git a/Assets/Scenes/LoadingMenu.unity b/Assets/Scenes/LoadingMenu.unity index 86ea276..6d72931 100644 --- a/Assets/Scenes/LoadingMenu.unity +++ b/Assets/Scenes/LoadingMenu.unity @@ -317,6 +317,50 @@ MonoBehaviour: invert: 0 addMore: {r: 0, g: 0, b: 0, a: 0} reverseAdd: 0 +--- !u!1 &478813365 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 478813367} + - component: {fileID: 478813366} + m_Layer: 0 + m_Name: BazookaManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &478813366 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 478813365} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a0df255fc60e6e3c88ebb94d2d88db4d, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::BazookaManager +--- !u!4 &478813367 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 478813365} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &705564542 GameObject: m_ObjectHideFlags: 0 @@ -1559,3 +1603,4 @@ SceneRoots: - {fileID: 1527575525} - {fileID: 759356942} - {fileID: 10778706} + - {fileID: 478813367} diff --git a/Assets/Scripts/BazookaManager.cs b/Assets/Scripts/BazookaManager.cs index f4caf55..26c0ca0 100644 --- a/Assets/Scripts/BazookaManager.cs +++ b/Assets/Scripts/BazookaManager.cs @@ -30,24 +30,23 @@ public class BazookaManager : MonoBehaviour var cache = LoadArray("cache"); if (save != null) { - saveFile = save; - if (saveFile["version"] == null) + if (save["version"] != null && (save["version"].ToString() == "0" || save["version"].ToString() == "1")) { - saveFile["version"] = "0"; - } - if (saveFile["version"].ToString() == "0") - { - if (saveFile["bird"]["customIcon"]["data"] != null) + saveFile = save; + if (saveFile["version"].ToString() == "0") { - var data = saveFile["bird"]["customIcon"]["data"]; - var customData = GetCustomBirdIconData(); - saveFile["bird"]["customIcon"]["data"].Parent.Remove(); - foreach (var icon in data) - if (icon["uuid"].ToString() != null) customData.Purchased.Add(icon["uuid"].ToString()); - SetCustomBirdIconData(customData); + if (saveFile["bird"]["customIcon"]["data"] != null) + { + var data = saveFile["bird"]["customIcon"]["data"]; + var customData = GetCustomBirdIconData(); + saveFile["bird"]["customIcon"]["data"].Parent.Remove(); + foreach (var icon in data) + if (icon["uuid"].ToString() != null) customData.Purchased.Add(icon["uuid"].ToString()); + SetCustomBirdIconData(customData); + } + saveFile["version"] = "1"; + Save("savefile", saveFile); } - saveFile["version"] = "1"; - Save("savefile", saveFile); } } if (cache != null)