프로필 카드 애님 완료

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 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()
{
@ -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;
}
}

View File

@ -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;