From 8906dd795dde33d7505500c437e653275bd021ed Mon Sep 17 00:00:00 2001 From: Ino Date: Fri, 3 Oct 2025 04:08:57 +0900 Subject: [PATCH] =?UTF-8?q?=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Game/Game_Lucky.cs | 9 +++---- Assets/Scripts/Game/LuckyGameObj.cs | 37 +++++++++++++++-------------- Assets/Scripts/UI/GachaUI.cs | 4 ++-- Assets/Scripts/UI/ProfileCard.cs | 1 - 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Assets/Scripts/Game/Game_Lucky.cs b/Assets/Scripts/Game/Game_Lucky.cs index fb37f8a..46b871c 100644 --- a/Assets/Scripts/Game/Game_Lucky.cs +++ b/Assets/Scripts/Game/Game_Lucky.cs @@ -197,9 +197,10 @@ public class Game_Lucky : MonoBehaviour texts_money[2].text = dic_Amount[eMoney.Gacha].ToString(); } - public void Add_Amount(eMoney money) + public void Add_Amount(eMoney money, int amount) { - ++dic_Amount[money]; dic_Amount[money].Obfuscate(); + dic_Amount[money] += amount; + dic_Amount[money].Obfuscate(); Set_Texts(); ++m_BubbleAmount; @@ -391,7 +392,7 @@ public class Game_Lucky : MonoBehaviour isRefill = false; } - public void Add_Ball(Vector3 pos) + public void Add_Ball(eMoney money, Vector3 pos) { for (int i = 0; i < tf_addobjs.childCount; i++) { @@ -399,7 +400,7 @@ public class Game_Lucky : MonoBehaviour if (!child.gameObject.activeInHierarchy) { list_dropobj.Add(child.gameObject); - child.GetComponent().Init_Add(pos, tf_fallobjs); + child.GetComponent().Init_Add(money, pos, tf_fallobjs); break; } } diff --git a/Assets/Scripts/Game/LuckyGameObj.cs b/Assets/Scripts/Game/LuckyGameObj.cs index 91ba48e..51d3419 100644 --- a/Assets/Scripts/Game/LuckyGameObj.cs +++ b/Assets/Scripts/Game/LuckyGameObj.cs @@ -40,30 +40,31 @@ public class LuckyGameObj : MonoBehaviour } public void Init(eMoney money, Vector3 pos, Transform tfcupin, Transform tffallobjs) + { + transform.parent = tfcupin; + Init_Common(money, pos, tffallobjs); + + isRandomBlock = isCollision = false; + m_Collider2D.enabled = isInCup = m_image.enabled = true; + } + public void Init_Add(eMoney money, Vector3 pos, Transform tffallobjs) + { + transform.parent = tffallobjs; + Init_Common(money, pos, tffallobjs); + + isInCup = isCollision = false; + isRandomBlock = m_Collider2D.enabled = m_image.enabled = true; + + } + void Init_Common(eMoney money, Vector3 pos, Transform tffallobjs) { gameObject.SetActive(true); m_Money = money; - transform.parent = tfcupin; transform.localPosition = pos; tf_fallobjs = tffallobjs; m_image.sprite = UIAtlasMgr.Ins.Get_Sprite(m_Money); - isRandomBlock = isCollision = false; - m_Collider2D.enabled = isInCup = m_image.enabled = true; - go_effect.SetActive(false); - m_Rigidbody2D.bodyType = RigidbodyType2D.Dynamic; - } - public void Init_Add(Vector3 pos, Transform tffallobjs) - { - gameObject.SetActive(true); - - transform.parent = tffallobjs; - transform.localPosition = pos; - tf_fallobjs = tffallobjs; - - isInCup = isCollision = false; - isRandomBlock = m_Collider2D.enabled = m_image.enabled = true; go_effect.SetActive(false); m_Rigidbody2D.bodyType = RigidbodyType2D.Dynamic; } @@ -106,7 +107,7 @@ public class LuckyGameObj : MonoBehaviour var addAmount = lrb.Get_Value(1); for (int i = 0; i < addAmount - 1; i++) { // 공 추가하기 - LobbyUI.Ins.m_Game_Lucky.Add_Ball(transform.localPosition); + LobbyUI.Ins.m_Game_Lucky.Add_Ball(m_Money, transform.localPosition); } } break; @@ -130,7 +131,7 @@ public class LuckyGameObj : MonoBehaviour void Set_Collision(int amount) { SoundInfo.Ins.Play_OneShot((eSound)Random.Range(16, 19)); - if (amount > 0) LobbyUI.Ins.m_Game_Lucky.Add_Amount(m_Money); + LobbyUI.Ins.m_Game_Lucky.Add_Amount(m_Money, amount); m_image.enabled = false; m_Collider2D.enabled = false; go_effect.SetActive(true); diff --git a/Assets/Scripts/UI/GachaUI.cs b/Assets/Scripts/UI/GachaUI.cs index c1cc9f4..d84dc2d 100644 --- a/Assets/Scripts/UI/GachaUI.cs +++ b/Assets/Scripts/UI/GachaUI.cs @@ -149,10 +149,10 @@ 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"))) { Init_GachaAnim(); - //SaveMgr.Ins.Add_Money(eMoney.Lucky, -table_GlobalValue.Ins.Get_Int("LuckyPoint")); + SaveMgr.Ins.Add_Money(eMoney.Lucky, -table_GlobalValue.Ins.Get_Int("LuckyPoint")); SaveMgr.Ins.Save(); LobbyUI.Ins.m_Game_Lucky.Set(); Set_UI(false); diff --git a/Assets/Scripts/UI/ProfileCard.cs b/Assets/Scripts/UI/ProfileCard.cs index 941cdc3..5d378a7 100644 --- a/Assets/Scripts/UI/ProfileCard.cs +++ b/Assets/Scripts/UI/ProfileCard.cs @@ -50,7 +50,6 @@ public class ProfileCard : MonoBehaviour go_viewbtn.SetActive(count == 0); go_albumbtn.SetActive(count > 0); go_chatbtn.SetActive(count > 0); - //go_chatbtn.SetActive(false); // 게등위 테스트 go_changegirl.SetActive(false); if (SaveMgr.Ins.IsObtainGirl(2)) { // 획득한 캐릭터 2종 이상