Draggable UI improvements

This commit is contained in:
2025-06-30 14:56:32 -07:00
parent 2d5d4004b4
commit 0c2483f249
3 changed files with 70 additions and 17 deletions

View File

@@ -45,10 +45,10 @@ public class GamePlayerPauseMenu : MonoBehaviour
});
resetUiButton.onClick.AddListener(() =>
{
fpsText.transform.localPosition = new Vector2(-432.5f, 375f);
scoreText.transform.localPosition = new Vector2(0f, 290f);
highScoreText.transform.localPosition = new Vector2(0f, 220f);
boostText.transform.localPosition = new Vector2(0f, 170f);
((RectTransform)fpsText.transform).anchoredPosition = new Vector2(210f, -35f);
((RectTransform)scoreText.transform).anchoredPosition = new Vector2(0f, -70f);
((RectTransform)highScoreText.transform).anchoredPosition = new Vector2(0f, -140f);
((RectTransform)boostText.transform).anchoredPosition = new Vector2(0f, -190f);
PlayerPrefs.DeleteKey("DraggedUIFPSText");
PlayerPrefs.DeleteKey("DraggedUIScoreText");
PlayerPrefs.DeleteKey("DraggedUIHighScoreText");

View File

@@ -2,5 +2,5 @@ using UnityEngine;
public class IgnoreRaycast : MonoBehaviour, ICanvasRaycastFilter
{
public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera) => false;
public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera) => GetComponent<DraggableUI>() != null && GetComponent<DraggableUI>().canDrag;
}