Fix latest version button not showing on scene reload
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user