カスタマイズ機能修正
This commit is contained in:
parent
89476907b8
commit
91e0ffbf09
|
|
@ -12,11 +12,8 @@ namespace MyGame.Scenes.marketing.Scripts
|
|||
[SerializeField] private MarketView marketView;
|
||||
[SerializeField] private ShopCustomizeView customizeView;
|
||||
[SerializeField] private ShopCustomizeSelector customizeSelector;
|
||||
private readonly Subject<Unit> purchasedNotify = new Subject<Unit>();
|
||||
private void Start()
|
||||
{
|
||||
purchasedNotify.AddTo(this);
|
||||
|
||||
SoundManager.Instance.PlayBGM("bgm_marketing");
|
||||
var gameData = GameDataManager.GameData;
|
||||
var customizeDataList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopCustomizeData>(Const.ShopCustomizeDataSheet);
|
||||
|
|
@ -70,20 +67,13 @@ myItems {string.Join(",", gameData.ShopCustomizeMyItems.Select(x => x.ToString()
|
|||
{
|
||||
item.SetState(ShopCustomizeItemState.Purchased);
|
||||
}
|
||||
else if (gameData.ShopCustomizeLevel >= customizeData.level)
|
||||
else if (gameData.ViewedShopLevel >= customizeData.level)
|
||||
{
|
||||
item.SetState(ShopCustomizeItemState.Unlock);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.SetState(ShopCustomizeItemState.Lock);
|
||||
purchasedNotify.Distinct()
|
||||
.Where(_ => gameData.ShopCustomizeLevel >= customizeData.level)
|
||||
.Take(1)
|
||||
.Subscribe(x =>
|
||||
{
|
||||
item.SetState(ShopCustomizeItemState.Unlock);
|
||||
}).AddTo(this);
|
||||
}
|
||||
|
||||
item.SelectObservable.Merge(selectSubject).Subscribe(_ =>
|
||||
|
|
@ -139,7 +129,6 @@ myItems {string.Join(",", gameData.ShopCustomizeMyItems.Select(x => x.ToString()
|
|||
gameData.ShopCustomizeLevel = level;
|
||||
GameDataManager.SaveGameData();
|
||||
customizeView.SetLevel(gameData.ShopCustomizeLevel);
|
||||
purchasedNotify.OnNext(Unit.Default);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue