From f4c1ebb83bfa93b56b016db7345b1389918be431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LUDWIG?= Date: Sat, 17 May 2025 19:47:23 +0200 Subject: [PATCH] fix: buttons scaling edit mode in 1280x720 --- Assets/Scenes/LevelEditorScene.unity | 10 +++++----- Assets/Scripts/LevelEditor.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Assets/Scenes/LevelEditorScene.unity b/Assets/Scenes/LevelEditorScene.unity index e4d1770..ead8a9d 100644 --- a/Assets/Scenes/LevelEditorScene.unity +++ b/Assets/Scenes/LevelEditorScene.unity @@ -5559,7 +5559,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: -359.836} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -498, y: 257.98} + m_AnchoredPosition: {x: -568, y: 293} m_SizeDelta: {x: 78.3177, y: 71.7616} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &590020933 @@ -5854,7 +5854,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 480.93127, y: 252.93127} + m_AnchoredPosition: {x: 579, y: 290} m_SizeDelta: {x: 81.8625, y: 81.8625} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &678214374 @@ -6157,7 +6157,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 357, y: -266} + m_AnchoredPosition: {x: -431, y: -307} m_SizeDelta: {x: 50, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &740715252 @@ -7342,7 +7342,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -437, y: -263} + m_AnchoredPosition: {x: -569, y: -306} m_SizeDelta: {x: 75, y: 75} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1561821049 @@ -7650,7 +7650,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 180} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 419, y: -266} + m_AnchoredPosition: {x: 150, y: -306} m_SizeDelta: {x: 50, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1628925094 diff --git a/Assets/Scripts/LevelEditor.cs b/Assets/Scripts/LevelEditor.cs index b249fc6..a5bccd7 100644 --- a/Assets/Scripts/LevelEditor.cs +++ b/Assets/Scripts/LevelEditor.cs @@ -99,8 +99,8 @@ public class LevelEditor : MonoBehaviour float xOff = -325f + idx * 125f; var bgRt = bg.GetComponent(); var icRt = icon.GetComponent(); - bgRt.anchoredPosition = new Vector2(xOff, bgRt.anchoredPosition.y - 70); - icRt.anchoredPosition = new Vector2(xOff, icRt.anchoredPosition.y - 70); + bgRt.anchoredPosition = new Vector2(xOff, bgRt.anchoredPosition.y - 110); + icRt.anchoredPosition = new Vector2(xOff, icRt.anchoredPosition.y - 110); bg.GetComponent().sprite = Resources.Load("InGame/ButtonSkin/BlankSquare"); icon.GetComponent().sprite = prefab.GetComponent()?.sprite; icRt.sizeDelta = prefab.name.ToLower().Contains("small")