럭키 포인트는 따로 로그 안뜨고 그냥 게이지만 올라가도록 수정 부탁드리겠습니다.
어차피 무조건 럭키 포인트는 쌓이기 때문에 로그 안보이고 게이지쪽에 증가 연출이 들어가는게 좋을거 같아요
This commit is contained in:
parent
09674f4caa
commit
ac68008ac4
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9df5d1d82e35edb4e98c606d7d69f8f4
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using TigerForge;
|
using TigerForge;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
|
public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
|
||||||
{
|
{
|
||||||
|
|
@ -91,18 +92,39 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
|
||||||
{
|
{
|
||||||
switch (money)
|
switch (money)
|
||||||
{
|
{
|
||||||
case eMoney.AlbumOpen: m_SaveData.MoneyHeart += add; break;
|
case eMoney.AlbumOpen:
|
||||||
case eMoney.Chat: m_SaveData.MoneyChatCoin += add; break;
|
m_SaveData.MoneyHeart += add;
|
||||||
case eMoney.Gacha: m_SaveData.MoneyGacha += add; break;
|
m_SaveData.MoneyHeart = Mathf.Max(m_SaveData.MoneyHeart, 0);
|
||||||
case eMoney.Lucky: m_SaveData.MoneyLucky += add; break;
|
break;
|
||||||
case eMoney.MiniGameHP: m_SaveData.MiniGameHP += add; break;
|
|
||||||
//case eMoney.ItemBomb: m_SaveData.ItemBomb += add; break;
|
case eMoney.Chat:
|
||||||
//case eMoney.ItemUmbrella: m_SaveData.ItemUmbrella += add; break;
|
m_SaveData.MoneyChatCoin += add;
|
||||||
//case eMoney.ItemDildo: m_SaveData.ItemDildo += add; break;
|
m_SaveData.MoneyChatCoin = Mathf.Max(m_SaveData.MoneyChatCoin, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case eMoney.Gacha:
|
||||||
|
m_SaveData.MoneyGacha += add;
|
||||||
|
m_SaveData.MoneyGacha = Mathf.Max(m_SaveData.MoneyGacha, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case eMoney.Lucky:
|
||||||
|
m_SaveData.MoneyLucky += add;
|
||||||
|
m_SaveData.MoneyLucky = Mathf.Max(m_SaveData.MoneyLucky, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case eMoney.MiniGameHP:
|
||||||
|
m_SaveData.MiniGameHP += add;
|
||||||
|
m_SaveData.MiniGameHP = Mathf.Max(m_SaveData.MiniGameHP, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
//case eMoney.ItemBomb: m_SaveData.ItemBomb += add; m_SaveData.ItemBomb = Mathf.Max(m_SaveData.ItemBomb, 0); break;
|
||||||
|
//case eMoney.ItemUmbrella: m_SaveData.ItemUmbrella += add; m_SaveData.ItemUmbrella = Mathf.Max(m_SaveData.ItemUmbrella, 0); break;
|
||||||
|
//case eMoney.ItemDildo: m_SaveData.ItemDildo += add; m_SaveData.ItemDildo = Mathf.Max(m_SaveData.ItemDildo, 0); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LobbyUI.Ins.Set_Money();
|
LobbyUI.Ins.Set_Money();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set_Money(eMoney money, int val)
|
public void Set_Money(eMoney money, int val)
|
||||||
{
|
{
|
||||||
switch (money)
|
switch (money)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
@ -17,21 +18,65 @@ public class GachaUI : uScrollViewMgr
|
||||||
{
|
{
|
||||||
gameObject.SetActive(true);
|
gameObject.SetActive(true);
|
||||||
DSUtil.InActivateGameObjects(gos_grade);
|
DSUtil.InActivateGameObjects(gos_grade);
|
||||||
Set_UI();
|
Set_UI(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Set_UI()
|
void Set_UI(bool updateSlider)
|
||||||
{
|
{
|
||||||
var cal = SaveMgr.Ins.Get_Money(eMoney.Lucky) / table_GlobalValue.Ins.Get_Float("LuckyPoint");
|
if (updateSlider)
|
||||||
slider_lucky.value = DSUtil.Get_SliderValue(cal);
|
{
|
||||||
slider_lucky2.value = DSUtil.Get_SliderValue(cal - 1f);
|
StartCoroutine(Co_UpdateSlider());
|
||||||
texts[0].text = MyText.Get_PercentValueText_100(cal);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var cal = SaveMgr.Ins.Get_Money(eMoney.Lucky) / table_GlobalValue.Ins.Get_Float("LuckyPoint");
|
||||||
|
slider_lucky.value = DSUtil.Get_SliderValue(cal);
|
||||||
|
slider_lucky2.value = DSUtil.Get_SliderValue(cal - 1f);
|
||||||
|
texts[0].text = MyText.Get_PercentValueText_100(cal > 2f ? 2f : cal);
|
||||||
|
}
|
||||||
|
|
||||||
go_CanEnterLuckyGame.SetActive(SaveMgr.Ins.Get_Money(eMoney.Lucky) >= table_GlobalValue.Ins.Get_Float("LuckyPoint"));
|
go_CanEnterLuckyGame.SetActive(SaveMgr.Ins.Get_Money(eMoney.Lucky) >= table_GlobalValue.Ins.Get_Float("LuckyPoint"));
|
||||||
|
|
||||||
Set_Money();
|
Set_Money();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IEnumerator Co_UpdateSlider()
|
||||||
|
{
|
||||||
|
float lucky = SaveMgr.Ins.Get_Money(eMoney.Lucky) / table_GlobalValue.Ins.Get_Float("LuckyPoint");
|
||||||
|
float targetValue1 = Mathf.Min(lucky, 1f); // slider_lucky 목표
|
||||||
|
float targetValue2 = Mathf.Max(lucky - 1f, 0f); // slider_lucky2 목표
|
||||||
|
|
||||||
|
float duration = 0.5f; // 각 슬라이더당 시간
|
||||||
|
float elapsed = 0f;
|
||||||
|
|
||||||
|
// slider_lucky 먼저
|
||||||
|
float startValue1 = slider_lucky.value;
|
||||||
|
while (elapsed < duration)
|
||||||
|
{
|
||||||
|
elapsed += Time.deltaTime;
|
||||||
|
float t = Mathf.Clamp01(elapsed / duration);
|
||||||
|
slider_lucky.value = Mathf.Lerp(startValue1, targetValue1, t);
|
||||||
|
texts[0].text = MyText.Get_PercentValueText_100(slider_lucky.value + slider_lucky2.value);
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
slider_lucky.value = targetValue1;
|
||||||
|
texts[0].text = MyText.Get_PercentValueText_100(slider_lucky.value + slider_lucky2.value);
|
||||||
|
|
||||||
|
// slider_lucky2 다음
|
||||||
|
elapsed = 0f;
|
||||||
|
float startValue2 = slider_lucky2.value;
|
||||||
|
while (elapsed < duration)
|
||||||
|
{
|
||||||
|
elapsed += Time.deltaTime;
|
||||||
|
float t = Mathf.Clamp01(elapsed / duration);
|
||||||
|
slider_lucky2.value = Mathf.Lerp(startValue2, targetValue2, t);
|
||||||
|
texts[0].text = MyText.Get_PercentValueText_100(slider_lucky.value + slider_lucky2.value);
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
slider_lucky2.value = targetValue2;
|
||||||
|
texts[0].text = MyText.Get_PercentValueText_100(slider_lucky.value + slider_lucky2.value);
|
||||||
|
}
|
||||||
|
|
||||||
void Set_Money()
|
void Set_Money()
|
||||||
{
|
{
|
||||||
texts_money[0].text = SaveMgr.Ins.Get_Money(eMoney.AlbumOpen).ToString();
|
texts_money[0].text = SaveMgr.Ins.Get_Money(eMoney.AlbumOpen).ToString();
|
||||||
|
|
@ -46,7 +91,7 @@ public class GachaUI : uScrollViewMgr
|
||||||
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();
|
SaveMgr.Ins.Save();
|
||||||
LobbyUI.Ins.m_Game_Lucky.Set();
|
LobbyUI.Ins.m_Game_Lucky.Set();
|
||||||
Set_UI();
|
Set_UI(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,6 +104,7 @@ public class GachaUI : uScrollViewMgr
|
||||||
SaveMgr.Ins.Add_Money(eMoney.Gacha, table_GlobalValue.Ins.Get_Int("GachaAD_Reward"));
|
SaveMgr.Ins.Add_Money(eMoney.Gacha, table_GlobalValue.Ins.Get_Int("GachaAD_Reward"));
|
||||||
SaveMgr.Ins.Add_GachaADTime(table_GlobalValue.Ins.Get_Int("ADSec_Gacha"));
|
SaveMgr.Ins.Add_GachaADTime(table_GlobalValue.Ins.Get_Int("ADSec_Gacha"));
|
||||||
LobbyUI.Ins.m_ToastUI.Set($"가챠 코인 {table_GlobalValue.Ins.Get_Int("GachaAD_Reward")}개를 획득했습니다.");
|
LobbyUI.Ins.m_ToastUI.Set($"가챠 코인 {table_GlobalValue.Ins.Get_Int("GachaAD_Reward")}개를 획득했습니다.");
|
||||||
|
Set_Money();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -75,10 +121,10 @@ public class GachaUI : uScrollViewMgr
|
||||||
SaveMgr.Ins.Add_Money(eMoney.Lucky, reward.Item3);
|
SaveMgr.Ins.Add_Money(eMoney.Lucky, reward.Item3);
|
||||||
SaveMgr.Ins.Save();
|
SaveMgr.Ins.Save();
|
||||||
list_log.Add((reward.Item1, reward.Item2));
|
list_log.Add((reward.Item1, reward.Item2));
|
||||||
list_log.Add((eMoney.Lucky, reward.Item3));
|
//list_log.Add((eMoney.Lucky, reward.Item3));
|
||||||
Set_ScrollView(list_log);
|
Set_ScrollView(list_log);
|
||||||
Set_Vertical_ScrollEnd(0);
|
Set_Vertical_ScrollEnd(0);
|
||||||
Set_UI();
|
Set_UI(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ public class LobbyCenterProfileUI : uScrollViewMgr
|
||||||
{
|
{
|
||||||
// 카드는 3개만 있으면 됨
|
// 카드는 3개만 있으면 됨
|
||||||
// 움직이는 연출 후 UI 갱신하면 될 듯
|
// 움직이는 연출 후 UI 갱신하면 될 듯
|
||||||
|
public ProfileCard[] arr_profileCard;
|
||||||
|
|
||||||
public void Set()
|
public void Set()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
사운드 및 BGM 요청
|
사운드 및 BGM 요청
|
||||||
|
|
||||||
럭키 포인트는 따로 로그 안뜨고 그냥 게이지만 올라가도록 수정 부탁드리겠습니다.
|
|
||||||
어차피 무조건 럭키 포인트는 쌓이기 때문에 로그 안보이고 게이지쪽에 증가 연출이 들어가는게 좋을거 같아요
|
|
||||||
|
|
||||||
훔쳐보기
|
훔쳐보기
|
||||||
프로필 카드
|
프로필 카드
|
||||||
광고 제거권
|
광고 제거권
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue