diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs index 0597bb9a..75ffe43b 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs @@ -12,12 +12,19 @@ namespace MyGame.Scenes.marketing.Scripts [SerializeField] private MarketView marketView; [SerializeField] private ShopCustomizeView customizeView; [SerializeField] private ShopCustomizeSelector customizeSelector; + private readonly Subject levelNotify = new Subject(); private void Start() { + levelNotify.AddTo(this); + var gameData = GameDataManager.GameData; var customizeDataList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ShopCustomizeDataSheet); - var customizeLevelList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ShopCustomizeLevelDataSheet); - var customizeBonusList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ShopCustomizeBonusDataSheet); +#if UNITY_EDITOR + Debug.Log($@" +coin {gameData.ShopCustomizeCoin} +myItems {string.Join(",", gameData.ShopCustomizeMyItems.Select(x => x.ToString()))} +"); +#endif if (!gameData.FinishedFlags.HasFlag(TutorialFlag.ShopCustomize)) { @@ -67,6 +74,13 @@ namespace MyGame.Scenes.marketing.Scripts else { item.SetState(ShopCustomizeItemState.Lock); + levelNotify.Distinct() + .Where(x => x >= customizeData.level) + .Take(1) + .Subscribe(x => + { + item.SetState(ShopCustomizeItemState.Unlock); + }).AddTo(this); } item.SelectObservable.Merge(selectSubject).Subscribe(_ => @@ -118,6 +132,7 @@ namespace MyGame.Scenes.marketing.Scripts var customizeLevelList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ShopCustomizeLevelDataSheet); var level = customizeLevelList.LastOrDefault(data => data.point <= gameData.ShopCustomizePoint)?.level ?? 1; + levelNotify.OnNext(level); gameData.ShopCustomizeLevel = level; GameDataManager.SaveGameData(); }