From a427a45121d4116dd2e7134e6212fad8aaea5bb4 Mon Sep 17 00:00:00 2001 From: Ino Date: Sun, 21 Sep 2025 07:40:43 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20=EC=B9=B4?= =?UTF-8?q?=EB=93=9C=20=EC=95=A0=EB=8B=98=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/LobbyCenterProfileUI.cs | 19 ++++++++++--------- Assets/Scripts/UI/ProfileCard.cs | 3 +++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/UI/LobbyCenterProfileUI.cs b/Assets/Scripts/UI/LobbyCenterProfileUI.cs index 9ca29c8..d572139 100644 --- a/Assets/Scripts/UI/LobbyCenterProfileUI.cs +++ b/Assets/Scripts/UI/LobbyCenterProfileUI.cs @@ -1,5 +1,5 @@ -using UnityEngine; using System.Collections; +using UnityEngine; public class LobbyCenterProfileUI : MonoBehaviour { @@ -15,7 +15,7 @@ public class LobbyCenterProfileUI : MonoBehaviour float scaleCenter = 1f; float scaleSide = 0.7f; - public float animDuration = 0.3f; + float animDuration = 0.3f; public void Set() { @@ -26,7 +26,7 @@ public class LobbyCenterProfileUI : MonoBehaviour SaveMgr.Ins.Set_SelectGirlID(curGirl); } - var pre_girl = curGirl - 1; + var pre_girl = curGirl - 1; if (pre_girl <= 0) pre_girl = 8; arr_profileCard[0].Set(pre_girl); @@ -45,6 +45,10 @@ public class LobbyCenterProfileUI : MonoBehaviour IEnumerator Co_MoveCard(int dir) { + curGirl = curGirl + dir; + if (curGirl > 8) curGirl = 1; + else if (curGirl < 1) curGirl = 8; + isAnimating = true; float elapsed = 0f; @@ -59,6 +63,7 @@ public class LobbyCenterProfileUI : MonoBehaviour if (dir == 1) // 오른쪽으로 이동 { newCard = arr_profileCard[0]; + newCard.Set(curGirl + dir); movingRect = newCard.rect; movingRect.anchoredPosition = posRight + new Vector2(500, 0); movingRect.localScale = Vector3.one * scaleSide; @@ -110,12 +115,12 @@ public class LobbyCenterProfileUI : MonoBehaviour arr_profileCard[1] = arr_profileCard[2]; arr_profileCard[2] = temp; - curGirl = curGirl + 1; - if (curGirl > 8) curGirl = 1; + } else if (dir == -1) // 왼쪽으로 이동 { newCard = arr_profileCard[2]; + newCard.Set(curGirl + dir); movingRect = newCard.rect; movingRect.anchoredPosition = posLeft + new Vector2(-500, 0); movingRect.localScale = Vector3.one * scaleSide; @@ -166,12 +171,8 @@ public class LobbyCenterProfileUI : MonoBehaviour arr_profileCard[2] = arr_profileCard[1]; arr_profileCard[1] = arr_profileCard[0]; arr_profileCard[0] = temp; - - curGirl = curGirl - 1; - if (curGirl <= 0) curGirl = 8; } - Set(); isAnimating = false; } } \ No newline at end of file diff --git a/Assets/Scripts/UI/ProfileCard.cs b/Assets/Scripts/UI/ProfileCard.cs index fa2668b..f76050f 100644 --- a/Assets/Scripts/UI/ProfileCard.cs +++ b/Assets/Scripts/UI/ProfileCard.cs @@ -20,6 +20,9 @@ public class ProfileCard : MonoBehaviour public void Set(int girlid) { + if (girlid < 1) girlid = 8; + else if (girlid > 8) girlid = 1; + m_Data = table_girl.Ins.Get_Data(girlid); i_girl.enabled = false;