상점 테이블 및 상점 ui, 상점 광고
This commit is contained in:
parent
2974b7436d
commit
c29d3749b7
|
|
@ -0,0 +1,9 @@
|
||||||
|
[{"s_ID": "com.fgb.weeklypackage", "e_BuyType": "IAP", "n_Price": "1000", "s_PeakEffective": "최대 효율 111%", "s_Items": "코인 x00
|
||||||
|
채팅 코인 x00", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "com.fgb.minigamepacakge", "e_BuyType": "IAP", "n_Price": "25000", "s_PeakEffective": "최대 효율 222%", "s_Items": "보너스 확률 +00%
|
||||||
|
코인 x00", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "com.fgb.buyone1", "e_BuyType": "IAP", "n_Price": "9900", "s_PeakEffective": "123%", "s_Items": "코인 x000
|
||||||
|
채팅 코인 x000", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "com.fgb.buyone2", "e_BuyType": "IAP", "n_Price": "55000", "s_PeakEffective": "135%", "s_Items": "코인 x000
|
||||||
|
가챠 코인 x000", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "com.fgb.chatbot1", "e_BuyType": "IAP", "n_Price": "5500", "s_PeakEffective": "105%", "s_Items": "코인 x00
|
||||||
|
채팅 코인 x00", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "com.fgb.chatbot2", "e_BuyType": "IAP", "n_Price": "9900", "s_PeakEffective": "102%", "s_Items": "보너스 확률 +00%
|
||||||
|
코인 x00", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "com.fgb.chatbot3", "e_BuyType": "IAP", "n_Price": "22000", "s_PeakEffective": "100%", "s_Items": "코인 x000
|
||||||
|
채팅 코인 x000", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "com.fgb.chatbot4", "e_BuyType": "IAP", "n_Price": "55000", "s_PeakEffective": "99%", "s_Items": "코인 x000
|
||||||
|
가챠 코인 x000", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "com.fgb.gacha1", "e_BuyType": "IAP", "n_Price": "1100", "s_PeakEffective": "", "s_Items": "x20", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "20", "n_ADSec": "0"}, {"s_ID": "com.fgb.gacha2", "e_BuyType": "IAP", "n_Price": "5500", "s_PeakEffective": "", "s_Items": "x110", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "110", "n_ADSec": "0"}, {"s_ID": "com.fgb.gacha3", "e_BuyType": "IAP", "n_Price": "27500", "s_PeakEffective": "", "s_Items": "x600", "n_RewardHeart": "0", "n_RewardChatCoin": "0", "n_RewardGacha": "600", "n_ADSec": "0"}, {"s_ID": "com.fgb.chatcoin1", "e_BuyType": "IAP", "n_Price": "1100", "s_PeakEffective": "", "s_Items": "x10", "n_RewardHeart": "0", "n_RewardChatCoin": "10", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "com.fgb.chatcoin2", "e_BuyType": "IAP", "n_Price": "5500", "s_PeakEffective": "", "s_Items": "x55", "n_RewardHeart": "0", "n_RewardChatCoin": "55", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "com.fgb.chatcoin3", "e_BuyType": "IAP", "n_Price": "27500", "s_PeakEffective": "", "s_Items": "x300", "n_RewardHeart": "0", "n_RewardChatCoin": "300", "n_RewardGacha": "0", "n_ADSec": "0"}, {"s_ID": "ad.chatcoin", "e_BuyType": "AD", "n_Price": "0", "s_PeakEffective": "", "s_Items": "x3", "n_RewardHeart": "0", "n_RewardChatCoin": "3", "n_RewardGacha": "0", "n_ADSec": "600"}, {"s_ID": "buy.chatcoin", "e_BuyType": "Coin", "n_Price": "50", "s_PeakEffective": "", "s_Items": "x1", "n_RewardHeart": "0", "n_RewardChatCoin": "1", "n_RewardGacha": "0", "n_ADSec": "0"}]
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a70b1a5a69942db45a8d861c699d18ee
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -16,6 +16,7 @@ GameObject:
|
||||||
- component: {fileID: -8931448971597107390}
|
- component: {fileID: -8931448971597107390}
|
||||||
- component: {fileID: 7007693330691602423}
|
- component: {fileID: 7007693330691602423}
|
||||||
- component: {fileID: 1208839188713729391}
|
- component: {fileID: 1208839188713729391}
|
||||||
|
- component: {fileID: -4118464485100682265}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Tables
|
m_Name: Tables
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -128,3 +129,16 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_json: {fileID: 4900000, guid: 222361f77d66c3144a8590dd2c3da445, type: 3}
|
m_json: {fileID: 4900000, guid: 222361f77d66c3144a8590dd2c3da445, type: 3}
|
||||||
|
--- !u!114 &-4118464485100682265
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4255407216469596348}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 88acb5221ff117d4b8f49b57f16918d3, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_json: {fileID: 4900000, guid: a70b1a5a69942db45a8d861c699d18ee, type: 3}
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,9 +1,14 @@
|
||||||
|
using GUPS.AntiCheat.Protected;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
public class albumtabledata : ShowAlbumBase
|
public class albumtabledata : ShowAlbumBase
|
||||||
{
|
{
|
||||||
public int n_Index, n_GirlID, n_Coin, n_Gem, n_Heart;
|
public int n_Index;
|
||||||
|
ProtectedInt32 _GirlID; public int n_GirlID { get { return _GirlID; } set { _GirlID = value; _GirlID.Obfuscate(); } }
|
||||||
|
ProtectedInt32 _Coin; public int n_Coin { get { return _Coin; } set { _Coin = value; _Coin.Obfuscate(); } }
|
||||||
|
ProtectedInt32 _Gem; public int n_Gem { get { return _Gem; } set { _Gem = value; _Gem.Obfuscate(); } }
|
||||||
|
ProtectedInt32 _Heart; public int n_Heart { get { return _Heart; } set { _Heart = value; _Heart.Obfuscate(); } }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class table_album : table_base
|
public class table_album : table_base
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
using GUPS.AntiCheat.Protected;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public enum eShopBuyType { IAP, AD, Coin }
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class shoptabledata
|
||||||
|
{
|
||||||
|
public string s_ID, s_PeakEffective, s_Items;
|
||||||
|
public eShopBuyType e_BuyType;
|
||||||
|
ProtectedInt32 _Price; public int n_Price { get { return _Price; } set { _Price = value; _Price.Obfuscate(); } }
|
||||||
|
ProtectedInt32 _RewardHeart; public int n_RewardHeart { get { return _RewardHeart; } set { _RewardHeart = value; _RewardHeart.Obfuscate(); } }
|
||||||
|
ProtectedInt32 _RewardChatCoin; public int n_RewardChatCoin { get { return _RewardChatCoin; } set { _RewardChatCoin = value; _RewardChatCoin.Obfuscate(); } }
|
||||||
|
ProtectedInt32 _RewardGacha; public int n_RewardGacha { get { return _RewardGacha; } set { _RewardGacha = value; _RewardGacha.Obfuscate(); } }
|
||||||
|
ProtectedInt32 _ADSec; public int n_ADSec { get { return _ADSec; } set { _ADSec = value; _ADSec.Obfuscate(); } }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class table_shop : table_base
|
||||||
|
{
|
||||||
|
public static table_shop Ins;
|
||||||
|
|
||||||
|
List<shoptabledata> tableDatas;
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
Ins = this;
|
||||||
|
base.Awake();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Start()
|
||||||
|
{
|
||||||
|
tableDatas = JsonConvert.DeserializeObject<List<shoptabledata>>(json_last);
|
||||||
|
base.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<shoptabledata> Get_DataList() { return tableDatas; }
|
||||||
|
public shoptabledata Get_Data(string id) { return Get_DataList().Find(f => f.s_ID.Equals(id)); }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 88acb5221ff117d4b8f49b57f16918d3
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,6 @@
|
||||||
using GUPS.AntiCheat.Protected;
|
using GUPS.AntiCheat.Protected;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using TigerForge;
|
using TigerForge;
|
||||||
|
|
||||||
|
|
@ -146,6 +147,19 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
|
||||||
|
|
||||||
public int Get_UnLockIndex() { return m_SaveData.GirlUnLockIndex; }
|
public int Get_UnLockIndex() { return m_SaveData.GirlUnLockIndex; }
|
||||||
public int Get_SelectGirlID() { return m_SaveData.SelectGirlID; }
|
public int Get_SelectGirlID() { return m_SaveData.SelectGirlID; }
|
||||||
|
|
||||||
|
public bool CanShowShopAD(bool showtoast = true)
|
||||||
|
{
|
||||||
|
var cal = m_SaveData.ShopADTime - InternetTime.Ins.Time;
|
||||||
|
var canshow = cal.TotalSeconds <= 0;
|
||||||
|
if (!canshow && showtoast) LobbyUI.Ins.m_ToastUI.Set($"{cal} 남음");
|
||||||
|
return canshow;
|
||||||
|
}
|
||||||
|
public void Add_ShopADTime(int sec)
|
||||||
|
{
|
||||||
|
m_SaveData.ShopADTime = InternetTime.Ins.Time.AddSeconds(sec);
|
||||||
|
Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SaveData
|
public class SaveData
|
||||||
|
|
@ -162,4 +176,6 @@ public class SaveData
|
||||||
ProtectedInt32 _MoneyChatCoin; public int MoneyChatCoin { get { return _MoneyChatCoin; } set { _MoneyChatCoin = value; _MoneyChatCoin.Obfuscate(); } }
|
ProtectedInt32 _MoneyChatCoin; public int MoneyChatCoin { get { return _MoneyChatCoin; } set { _MoneyChatCoin = value; _MoneyChatCoin.Obfuscate(); } }
|
||||||
ProtectedInt32 _MoneyGacha; public int MoneyGacha { get { return _MoneyGacha; } set { _MoneyGacha = value; _MoneyGacha.Obfuscate(); } }
|
ProtectedInt32 _MoneyGacha; public int MoneyGacha { get { return _MoneyGacha; } set { _MoneyGacha = value; _MoneyGacha.Obfuscate(); } }
|
||||||
ProtectedInt32 _MoneyLucky; public int MoneyLucky { get { return _MoneyLucky; } set { _MoneyLucky = value; _MoneyLucky.Obfuscate(); } }
|
ProtectedInt32 _MoneyLucky; public int MoneyLucky { get { return _MoneyLucky; } set { _MoneyLucky = value; _MoneyLucky.Obfuscate(); } }
|
||||||
|
|
||||||
|
ProtectedDateTime _ShopADTime; public DateTime ShopADTime { get { return _ShopADTime; } set { _ShopADTime = value; _ShopADTime.Obfuscate(); } }
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class ShopCard : MonoBehaviour
|
||||||
|
{
|
||||||
|
public string m_ID;
|
||||||
|
public Image i_shopitem;
|
||||||
|
public TextMeshProUGUI t_peakefficiency;
|
||||||
|
public TextMeshProUGUI t_goods;
|
||||||
|
public TextMeshProUGUI t_price;
|
||||||
|
|
||||||
|
shoptabledata m_Data;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
private void Reset()
|
||||||
|
{
|
||||||
|
i_shopitem = DSUtil.Get_Child_T<Image>(gameObject, "i_shopitem");
|
||||||
|
t_peakefficiency = DSUtil.Get_Child_T<TextMeshProUGUI>(gameObject, "t_peakefficiency");
|
||||||
|
t_goods = DSUtil.Get_Child_T<TextMeshProUGUI>(gameObject, "t_goods");
|
||||||
|
t_price = DSUtil.Get_Child_T<TextMeshProUGUI>(gameObject, "t_price");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
var btn = DSUtil.Get_Child_T<Button>(gameObject, "btn_buy");
|
||||||
|
btn.onClick.RemoveAllListeners();
|
||||||
|
btn.onClick.AddListener(OnClick_Button);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
m_Data = table_shop.Ins.Get_Data(m_ID);
|
||||||
|
if (t_peakefficiency != null) t_peakefficiency.text = m_Data.s_PeakEffective;
|
||||||
|
t_goods.text = m_Data.s_Items;
|
||||||
|
t_price.text = m_Data.e_BuyType == eShopBuyType.IAP ? $"\\{m_Data.n_Price}" : m_Data.n_Price.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnClick_Button()
|
||||||
|
{
|
||||||
|
switch (m_Data.e_BuyType)
|
||||||
|
{
|
||||||
|
case eShopBuyType.IAP:
|
||||||
|
break;
|
||||||
|
case eShopBuyType.AD:
|
||||||
|
if (SaveMgr.Ins.CanShowShopAD())
|
||||||
|
{
|
||||||
|
// TODO : 광고 보기
|
||||||
|
SaveMgr.Ins.Add_Money(eMoney.Chat, m_Data.n_RewardChatCoin);
|
||||||
|
SaveMgr.Ins.Add_ShopADTime(m_Data.n_ADSec);
|
||||||
|
LobbyUI.Ins.m_ToastUI.Set($"채팅 코인 {m_Data.n_RewardChatCoin}개를 획득했습니다.");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case eShopBuyType.Coin:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bc05ed100b5a0a642a61a7f3dcf8851c
|
||||||
|
|
@ -947,6 +947,13 @@ public static partial class DSUtil
|
||||||
|
|
||||||
public static bool WithInDistance(Vector3 a, Vector3 b, float dist) { return Get_Distance(a, b) <= dist * dist; }
|
public static bool WithInDistance(Vector3 a, Vector3 b, float dist) { return Get_Distance(a, b) <= dist * dist; }
|
||||||
public static float Get_Distance(Vector3 a, Vector3 b) { return (a - b).sqrMagnitude; }
|
public static float Get_Distance(Vector3 a, Vector3 b) { return (a - b).sqrMagnitude; }
|
||||||
|
|
||||||
|
public static T Get_Child_T<T>(GameObject parent, string name) where T : Component
|
||||||
|
{
|
||||||
|
var lst = parent.GetComponentsInChildren<T>(true);
|
||||||
|
if (lst == null) return null;
|
||||||
|
return lst.FirstOrDefault(t => t.name == name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NumberFormatter
|
public class NumberFormatter
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
게임 접속 시 출석부 받을 거 있으면 바로 뜨기
|
||||||
|
보상 받은 뒤 토스트 보여주기
|
||||||
|
|
||||||
|
사운드 및 BGM 요청
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 353371054d9bce34893c10680cdf5859
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Loading…
Reference in New Issue