프로필 카드 애님 완료

This commit is contained in:
Ino 2025-09-21 07:40:43 +09:00
parent 1a186fa277
commit a427a45121
2 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,5 @@
using UnityEngine;
using System.Collections; using System.Collections;
using UnityEngine;
public class LobbyCenterProfileUI : MonoBehaviour public class LobbyCenterProfileUI : MonoBehaviour
{ {
@ -15,7 +15,7 @@ public class LobbyCenterProfileUI : MonoBehaviour
float scaleCenter = 1f; float scaleCenter = 1f;
float scaleSide = 0.7f; float scaleSide = 0.7f;
public float animDuration = 0.3f; float animDuration = 0.3f;
public void Set() public void Set()
{ {
@ -26,7 +26,7 @@ public class LobbyCenterProfileUI : MonoBehaviour
SaveMgr.Ins.Set_SelectGirlID(curGirl); SaveMgr.Ins.Set_SelectGirlID(curGirl);
} }
var pre_girl = curGirl - 1; var pre_girl = curGirl - 1;
if (pre_girl <= 0) pre_girl = 8; if (pre_girl <= 0) pre_girl = 8;
arr_profileCard[0].Set(pre_girl); arr_profileCard[0].Set(pre_girl);
@ -45,6 +45,10 @@ public class LobbyCenterProfileUI : MonoBehaviour
IEnumerator Co_MoveCard(int dir) IEnumerator Co_MoveCard(int dir)
{ {
curGirl = curGirl + dir;
if (curGirl > 8) curGirl = 1;
else if (curGirl < 1) curGirl = 8;
isAnimating = true; isAnimating = true;
float elapsed = 0f; float elapsed = 0f;
@ -59,6 +63,7 @@ public class LobbyCenterProfileUI : MonoBehaviour
if (dir == 1) // 오른쪽으로 이동 if (dir == 1) // 오른쪽으로 이동
{ {
newCard = arr_profileCard[0]; newCard = arr_profileCard[0];
newCard.Set(curGirl + dir);
movingRect = newCard.rect; movingRect = newCard.rect;
movingRect.anchoredPosition = posRight + new Vector2(500, 0); movingRect.anchoredPosition = posRight + new Vector2(500, 0);
movingRect.localScale = Vector3.one * scaleSide; movingRect.localScale = Vector3.one * scaleSide;
@ -110,12 +115,12 @@ public class LobbyCenterProfileUI : MonoBehaviour
arr_profileCard[1] = arr_profileCard[2]; arr_profileCard[1] = arr_profileCard[2];
arr_profileCard[2] = temp; arr_profileCard[2] = temp;
curGirl = curGirl + 1;
if (curGirl > 8) curGirl = 1;
} }
else if (dir == -1) // 왼쪽으로 이동 else if (dir == -1) // 왼쪽으로 이동
{ {
newCard = arr_profileCard[2]; newCard = arr_profileCard[2];
newCard.Set(curGirl + dir);
movingRect = newCard.rect; movingRect = newCard.rect;
movingRect.anchoredPosition = posLeft + new Vector2(-500, 0); movingRect.anchoredPosition = posLeft + new Vector2(-500, 0);
movingRect.localScale = Vector3.one * scaleSide; movingRect.localScale = Vector3.one * scaleSide;
@ -166,12 +171,8 @@ public class LobbyCenterProfileUI : MonoBehaviour
arr_profileCard[2] = arr_profileCard[1]; arr_profileCard[2] = arr_profileCard[1];
arr_profileCard[1] = arr_profileCard[0]; arr_profileCard[1] = arr_profileCard[0];
arr_profileCard[0] = temp; arr_profileCard[0] = temp;
curGirl = curGirl - 1;
if (curGirl <= 0) curGirl = 8;
} }
Set();
isAnimating = false; isAnimating = false;
} }
} }

View File

@ -20,6 +20,9 @@ public class ProfileCard : MonoBehaviour
public void Set(int girlid) public void Set(int girlid)
{ {
if (girlid < 1) girlid = 8;
else if (girlid > 8) girlid = 1;
m_Data = table_girl.Ins.Get_Data(girlid); m_Data = table_girl.Ins.Get_Data(girlid);
i_girl.enabled = false; i_girl.enabled = false;