미니 게임 모드에서는 토스트 메시지 위치를 해당 영역까지 내려주시면 좋겠습니다.

This commit is contained in:
Ino 2025-11-06 21:05:22 +09:00
parent dda6f5aa45
commit fe1c2e06ca
10 changed files with 43 additions and 26 deletions

View File

@ -160,7 +160,8 @@ TextureImporter:
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
nameFileIdTable:
Yellow btn_0: -8223418744081684699
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:

View File

@ -160,7 +160,8 @@ TextureImporter:
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
nameFileIdTable:
money_gacha_0: -2564784036462105596
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:

View File

@ -160,7 +160,8 @@ TextureImporter:
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
nameFileIdTable:
shop money icon 11_shop_0: -1600953111491908714
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:

View File

@ -160,7 +160,8 @@ TextureImporter:
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
nameFileIdTable:
shop money icon 1_shop_0: 2323692047724358990
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:

View File

@ -160,7 +160,8 @@ TextureImporter:
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
nameFileIdTable:
shop money icon 2_shop_0: -4648769833049646530
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:

View File

@ -160,7 +160,8 @@ TextureImporter:
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
nameFileIdTable:
shop money icon 3_shop_0: -2795311806911105304
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:

View File

@ -781,11 +781,11 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 1703079399}
m_TargetAssemblyTypeName: LobbyUI, Assembly-CSharp
m_MethodName: OnClick_Button
m_Mode: 2
m_MethodName: Go_Home
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 21832900}
m_ObjectArgumentAssemblyTypeName: UnityEngine.GameObject, UnityEngine
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
@ -52953,10 +52953,10 @@ RectTransform:
- {fileID: 1902189015}
m_Father: {fileID: 817765913}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 163}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 162}
m_SizeDelta: {x: 0, y: 1920}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1357839140
MonoBehaviour:

View File

@ -167,7 +167,7 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
}
return 0;
}
public bool Check_Money(eMoney money, int amount, bool showToast = true)
public bool Check_Money(eMoney money, int amount, bool showToast = true, float toasty = 0f)
{
var enough = Get_Money(money) >= amount;
if (!enough && showToast)
@ -175,22 +175,22 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
switch (money)
{
case eMoney.AlbumOpen:
LobbyUI.Ins.m_ToastUI.Set("하트가 부족합니다.");
LobbyUI.Ins.m_ToastUI.Set("하트가 부족합니다.", toasty);
break;
case eMoney.Chat:
LobbyUI.Ins.m_ToastUI.Set("채팅 코인이 부족합니다.");
LobbyUI.Ins.m_ToastUI.Set("채팅 코인이 부족합니다.", toasty);
break;
case eMoney.Gacha:
LobbyUI.Ins.m_ToastUI.Set("뽑기 재화가 부족합니다.");
LobbyUI.Ins.m_ToastUI.Set("뽑기 재화가 부족합니다.", toasty);
break;
case eMoney.Lucky:
LobbyUI.Ins.m_ToastUI.Set("럭키 포인트가 부족합니다.");
LobbyUI.Ins.m_ToastUI.Set("럭키 포인트가 부족합니다.", toasty);
break;
case eMoney.MiniGameHP:
case eMoney.ItemBomb:
case eMoney.ItemUmbrella:
case eMoney.ItemDildo:
LobbyUI.Ins.m_ToastUI.Set("재화가 부족합니다.");
LobbyUI.Ins.m_ToastUI.Set("재화가 부족합니다.", toasty);
break;
}
}

View File

@ -20,7 +20,7 @@ public class GachaUI : uScrollViewMgr
public Slider slider_charge;
DateTime GachaAutoRefillTime;
float fRefillTime;
float fRefillTime, ToastY = -400f;
List<(eMoney, int)> list_log = new List<(eMoney, int)>();
Coroutine co_sliderupdate;
@ -45,7 +45,7 @@ public class GachaUI : uScrollViewMgr
{
SaveMgr.Ins.Add_Money(eMoney.Gacha, table_GlobalValue.Ins.Get_Int("GachaAutoRefill_Amount"));
SaveMgr.Ins.Save();
LobbyUI.Ins.m_ToastUI.Set($"뽑기 재화 {table_GlobalValue.Ins.Get_Int("GachaAutoRefill_Amount")}개가 충전되었습니다.");
LobbyUI.Ins.m_ToastUI.Set($"뽑기 재화 {table_GlobalValue.Ins.Get_Int("GachaAutoRefill_Amount")}개가 충전되었습니다.", ToastY);
Set_Money();
}
@ -149,7 +149,7 @@ public class GachaUI : uScrollViewMgr
public void OnClick_Lucky()
{
if (SaveMgr.Ins.Check_Money(eMoney.Lucky, table_GlobalValue.Ins.Get_Int("LuckyPoint")))
if (SaveMgr.Ins.Check_Money(eMoney.Lucky, table_GlobalValue.Ins.Get_Int("LuckyPoint"), true, ToastY))
{
Init_GachaAnim();
SaveMgr.Ins.Add_Money(eMoney.Lucky, -table_GlobalValue.Ins.Get_Int("LuckyPoint"));
@ -166,7 +166,7 @@ public class GachaUI : uScrollViewMgr
ADInfo.Ins.Show_AD(false, () =>
{
SaveMgr.Ins.Add_Money(eMoney.Gacha, table_GlobalValue.Ins.Get_Int("GachaAD_Reward"));
LobbyUI.Ins.m_ToastUI.Set($"뽑기 재화 {table_GlobalValue.Ins.Get_Int("GachaAD_Reward")}개를 획득했습니다.");
LobbyUI.Ins.m_ToastUI.Set($"뽑기 재화 {table_GlobalValue.Ins.Get_Int("GachaAD_Reward")}개를 획득했습니다.", ToastY);
Set_Money();
});
}
@ -174,7 +174,7 @@ public class GachaUI : uScrollViewMgr
public void OnClick_Gacha()
{
if (!isGacha && SaveMgr.Ins.Check_Money(eMoney.Gacha, table_GlobalValue.Ins.Get_Int("GachaAmount")))
if (!isGacha && SaveMgr.Ins.Check_Money(eMoney.Gacha, table_GlobalValue.Ins.Get_Int("GachaAmount"), true, ToastY))
StartCoroutine(Co_Gacha());
}

View File

@ -6,12 +6,23 @@ public class ToastUI : MonoBehaviour
public RectTransform rt_bg;
public TextMeshProUGUI t_mgs;
public void Set(string text)
Vector2 basePos; // 기준 위치 저장용
private void Awake()
{
basePos = (transform as RectTransform).anchoredPosition;
}
public void Set(string text, float y = 0f)
{
gameObject.SetActive(true);
t_mgs.text = text;
rt_bg.sizeDelta = new Vector2(rt_bg.sizeDelta.x, t_mgs.preferredHeight + 50);
// 위치 조정 (y값 있으면 기준 위치에서 더함)
var rt = transform as RectTransform;
rt.anchoredPosition = basePos + new Vector2(0f, y);
if (IsInvoking()) CancelInvoke();
Invoke("Off", 3f);
}