Make levelText movable

This commit is contained in:
2026-02-08 00:43:07 -07:00
parent 4779003126
commit ab66b041fb
2 changed files with 5 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ public class GamePlayerPauseMenu : MonoBehaviour
[SerializeField] private TMP_Text highScoreText;
[SerializeField] private TMP_Text boostText;
[SerializeField] private TMP_Text coinsText;
[SerializeField] private TMP_Text levelText;
[SerializeField] private Button pauseButton;
[SerializeField] private Button restartButton;
[SerializeField] private Button jumpButton;
@@ -58,10 +59,12 @@ public class GamePlayerPauseMenu : MonoBehaviour
((RectTransform)highScoreText.transform).anchoredPosition = new Vector2(0f, -140f);
((RectTransform)boostText.transform).anchoredPosition = new Vector2(0f, -190f);
((RectTransform)coinsText.transform).anchoredPosition = new Vector2(260f, 47.5f);
((RectTransform)levelText.transform).anchoredPosition = new Vector2(-260f, 85f);
PlayerPrefs.DeleteKey("DraggedUIScoreText");
PlayerPrefs.DeleteKey("DraggedUIHighScoreText");
PlayerPrefs.DeleteKey("DraggedUIBoostText");
PlayerPrefs.DeleteKey("DraggedUICoinsText");
PlayerPrefs.DeleteKey("DraggedUILevelText");
if (Application.isMobilePlatform)
{
((RectTransform)pauseButton.transform).anchoredPosition = new Vector2(128f, -128f);
@@ -151,6 +154,7 @@ public class GamePlayerPauseMenu : MonoBehaviour
highScoreText.GetComponent<DraggableUI>().canDrag = !highScoreText.GetComponent<DraggableUI>().canDrag;
boostText.GetComponent<DraggableUI>().canDrag = !boostText.GetComponent<DraggableUI>().canDrag;
coinsText.GetComponent<DraggableUI>().canDrag = !coinsText.GetComponent<DraggableUI>().canDrag;
levelText.GetComponent<DraggableUI>().canDrag = !levelText.GetComponent<DraggableUI>().canDrag;
if (Application.isMobilePlatform)
{
var pauseDraggableUI = pauseButton.GetComponent<DraggableUI>();