Fix latest version button not showing on scene reload

This commit is contained in:
Lncvrt committed 2025-07-06 16:37:26 -07:00
1 parent 8c7210e33f
commit 47c7fc89e8
3 files changed
+4 -5

No files matched your search

+1 -2
View File
@@ -49,8 +49,7 @@ public class DraggableUI : MonoBehaviour, IDragHandler, IBeginDragHandler
public void OnEnable()
{
string key = "DraggedUI" + uiName;
if (PlayerPrefs.HasKey(key) && TryParseVector3(PlayerPrefs.GetString(key), out Vector3 savedPos))
transform.localPosition = savedPos;
if (PlayerPrefs.HasKey(key) && TryParseVector3(PlayerPrefs.GetString(key), out Vector3 savedPos)) transform.localPosition = savedPos;
}
public void Update()
+2 -2
View File
@@ -55,19 +55,19 @@ public class LatestVersionText : MonoBehaviour
else
{
latest = request.downloadHandler.text;
if (updateButton != null) updateButton.gameObject.SetActive(latest != Application.version);
}
RefreshText();
}
public void RefreshText()
{
if (text == null) return;
if (text == null || updateButton == null) return;
if (latest == null)
text.text = "Latest: Loading...";
else if (latest == "-1")
text.text = "Latest: N/A";
else
text.text = "Latest: v" + latest;
updateButton.gameObject.SetActive(latest != Application.version);
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ public class MenuScript : MonoBehaviour
LatestVersionText.Instance.updateButton = updateButton;
LatestVersionText.Instance.RefreshText();
if (Application.isMobilePlatform || Application.isEditor || Application.platform == RuntimePlatform.WebGLPlayer)
if (Application.isMobilePlatform || Application.isEditor)
{
exitButton.gameObject.SetActive(false);
}