diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 03de4e9..ba5f00d 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -19062,6 +19062,10 @@ PrefabInstance: propertyPath: m_Name value: Sparkle_ellow objectReference: {fileID: 0} + - target: {fileID: 4033412786151888123, guid: 49057b33ea71fbb4da4e8f02a8db9f28, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4123381426564554493, guid: 49057b33ea71fbb4da4e8f02a8db9f28, type: 3} propertyPath: m_Materials.Array.size value: 1 @@ -31912,8 +31916,8 @@ RectTransform: m_Children: - {fileID: 495464322} - {fileID: 1456577417} - - {fileID: 952113712} - {fileID: 855260481} + - {fileID: 952113712} - {fileID: 1784439583} - {fileID: 662108378} m_Father: {fileID: 1861711112} @@ -32300,6 +32304,10 @@ PrefabInstance: propertyPath: m_Name value: Shine_pink objectReference: {fileID: 0} + - target: {fileID: 4109064841345302812, guid: 2a409ab125c5216449bc5f005ec045f0, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4109064841345302813, guid: 2a409ab125c5216449bc5f005ec045f0, type: 3} propertyPath: m_LocalScale.x value: 50 @@ -35626,6 +35634,10 @@ PrefabInstance: propertyPath: m_Name value: Shine_ellow objectReference: {fileID: 0} + - target: {fileID: 7938384439400024403, guid: b6e54acc881a03c4a9719b161a25a3e3, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -57758,6 +57770,10 @@ PrefabInstance: propertyPath: m_Name value: Shine_blue objectReference: {fileID: 0} + - target: {fileID: 245581523800709616, guid: 9442d241d2d8ecc47b49f256b55325c6, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 245581523800709617, guid: 9442d241d2d8ecc47b49f256b55325c6, type: 3} propertyPath: m_LocalScale.x value: 50 @@ -67213,9 +67229,7 @@ MonoBehaviour: - {fileID: 278813020} - {fileID: 2057533035} - {fileID: 1227751126} - gos_minigame: - - {fileID: 168358557} - - {fileID: 2079832695} + go_minigamechargingbtn: {fileID: 2079832695} slider_minigamecharging: {fileID: 404172103} t_minigamechargingtime: {fileID: 644731195} m_AttandanceUI: {fileID: 388368217} @@ -68421,7 +68435,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0.21960786, g: 0.21960786, b: 0.21960786, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: @@ -80539,8 +80553,8 @@ MonoBehaviour: - {fileID: 1988220643} - {fileID: 495464323} - {fileID: 1456577418} - - {fileID: 952113713} - {fileID: 855260482} + - {fileID: 952113713} - {fileID: 1044263884} --- !u!1 &2014651059 GameObject: @@ -83046,7 +83060,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: diff --git a/Assets/Scripts/AttachToGameObject/ADInfo.cs b/Assets/Scripts/AttachToGameObject/ADInfo.cs index 975d2dc..af54e34 100644 --- a/Assets/Scripts/AttachToGameObject/ADInfo.cs +++ b/Assets/Scripts/AttachToGameObject/ADInfo.cs @@ -142,7 +142,7 @@ public class ADInfo : MonoBehaviourSingletonTemplate, // =========================================================== public void OnUnityAdsShowComplete(string placementId, UnityAdsShowCompletionState showCompletionState) { - if (placementId == placement_Rewarded && showCompletionState == UnityAdsShowCompletionState.COMPLETED) + if (showCompletionState == UnityAdsShowCompletionState.COMPLETED) GetReward = 1; else GetReward = 2; diff --git a/Assets/Scripts/UI/LobbyUI.cs b/Assets/Scripts/UI/LobbyUI.cs index 2d72dee..97ced54 100644 --- a/Assets/Scripts/UI/LobbyUI.cs +++ b/Assets/Scripts/UI/LobbyUI.cs @@ -6,7 +6,7 @@ using UnityEngine.UI; public class LobbyUI : MonoBehaviourSingletonTemplate { [SerializeField] TextMeshProUGUI[] texts_money; // 0 앨범 개방 재화, 1 채팅 재화, 2 뽑기 재화, 3 4 미니게임 체력 - public GameObject[] gos_minigame; // 0 입장, 1 차징 + public GameObject go_minigamechargingbtn; public Slider slider_minigamecharging; public TextMeshProUGUI t_minigamechargingtime; float minigamechargingTime = 0f; @@ -35,30 +35,31 @@ public class LobbyUI : MonoBehaviourSingletonTemplate public Image[] images_botbtn; // 0 앨범, 1 상점 int CurMenu = 2; + bool bUpdate = false; IEnumerator Start() { + bUpdate = false; + yield return null; if (SaveMgr.Ins.CanGet_Attandance()) m_AttandanceUI.Set(); ADInfo.Ins.Set_Banner(true); m_LobbyCenterProfileUI.Set(); minigamechargingTime = (float)(SaveMgr.Ins.Get_MiniGameTime() - InternetTime.Ins.Time).TotalMilliseconds * 0.001f; - DSUtil.InActivateGameObjects(gos_minigame, minigamechargingTime > 0f ? 1 : 0); - //Act_Repeat_for1sec = () => - //{ - // if (SaveMgr.Ins.Get_Money(eMoney.MiniGameHP) <= 0) - // { - // var cal = - // } - //}; + go_minigamechargingbtn.SetActive(minigamechargingTime > 0f); + if (minigamechargingTime <= 0f) Check_MiniGameCharging(); + + bUpdate = true; } protected override void Update() { base.Update(); + if (!bUpdate) return; + var cal = SaveMgr.Ins.Get_MiniGameTime() - InternetTime.Ins.Time; - if ((cal.TotalMilliseconds > 0 || minigamechargingTime > 0) && !SaveMgr.Ins.Check_Money(eMoney.MiniGameHP, 1, false)) + if (!SaveMgr.Ins.Check_Money(eMoney.MiniGameHP, table_GlobalValue.Ins.Get_Int("MiniGame_TotalEnterMoney"), false)) { minigamechargingTime -= Time.deltaTime; t_minigamechargingtime.text = minigamechargingTime > 0f ? $"{minigamechargingTime:F2}s" : "0s"; @@ -66,20 +67,30 @@ public class LobbyUI : MonoBehaviourSingletonTemplate slider_minigamecharging.value = DSUtil.Get_SliderValue(minigamechargingTime / fRefillTimeMax); if (cal.TotalSeconds <= 0 && minigamechargingTime <= 0f) - MiniGameAllCharging(); + MiniGameCharging(); } - else if (!SaveMgr.Ins.Check_Money(eMoney.MiniGameHP, 1, false)) - MiniGameAllCharging(); } - void MiniGameAllCharging() + void MiniGameCharging() { - SaveMgr.Ins.Set_Money(eMoney.MiniGameHP, table_GlobalValue.Ins.Get_Int("MiniGame_TotalEnterMoney")); - SaveMgr.Ins.Save(); - m_ToastUI.Set($"미니게임 체력이 모두 충전되었습니다."); - if (CurMenu == 2) - DSUtil.InActivateGameObjects(gos_minigame, minigamechargingTime > 0f ? 1 : 0); - + SaveMgr.Ins.Add_Money(eMoney.MiniGameHP); + m_ToastUI.Set($"미니게임 체력이 충전되었습니다."); + Check_MiniGameCharging(); Set_Money(); + SaveMgr.Ins.Save(); + } + void Check_MiniGameCharging() + { + if (!SaveMgr.Ins.Check_Money(eMoney.MiniGameHP, table_GlobalValue.Ins.Get_Int("MiniGame_TotalEnterMoney"), false)) + { + var cal = SaveMgr.Ins.Get_MiniGameTime() - InternetTime.Ins.Time; + if (cal.TotalMilliseconds <= 0f) + { + SaveMgr.Ins.Set_MiniGameTime(); + minigamechargingTime = table_GlobalValue.Ins.Get_Int("MiniGame_EnterMoney_Time"); + } + } + + if (CurMenu == 2) go_minigamechargingbtn.SetActive(minigamechargingTime > 0f); } public void OnClick_Button(GameObject btn) @@ -161,12 +172,7 @@ public class LobbyUI : MonoBehaviourSingletonTemplate public void MiniGameResult() { SaveMgr.Ins.Add_Money(eMoney.MiniGameHP, -1); - if (!SaveMgr.Ins.Check_Money(eMoney.MiniGameHP, 1, false)) - { - SaveMgr.Ins.Set_MiniGameTime(); - minigamechargingTime = table_GlobalValue.Ins.Get_Int("MiniGame_EnterMoney_Time"); - DSUtil.InActivateGameObjects(gos_minigame, 1); - } + Check_MiniGameCharging(); } public void Go_Home() @@ -176,7 +182,7 @@ public class LobbyUI : MonoBehaviourSingletonTemplate m_GachaUI.gameObject.SetActive(false); go_shop.SetActive(false); DSUtil.ActivateGameObjects(gos_homeBot); - DSUtil.InActivateGameObjects(gos_minigame, minigamechargingTime > 0f ? 1 : 0); + go_minigamechargingbtn.SetActive(minigamechargingTime > 0f); } public void Go_Album(int girlid)