カスタマイズ機能修正
This commit is contained in:
parent
fe48169373
commit
90a5b39aaa
|
|
@ -12,12 +12,19 @@ namespace MyGame.Scenes.marketing.Scripts
|
|||
[SerializeField] private MarketView marketView;
|
||||
[SerializeField] private ShopCustomizeView customizeView;
|
||||
[SerializeField] private ShopCustomizeSelector customizeSelector;
|
||||
private readonly Subject<int> levelNotify = new Subject<int>();
|
||||
private void Start()
|
||||
{
|
||||
levelNotify.AddTo(this);
|
||||
|
||||
var gameData = GameDataManager.GameData;
|
||||
var customizeDataList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopCustomizeData>(Const.ShopCustomizeDataSheet);
|
||||
var customizeLevelList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopCustomizeLevelData>(Const.ShopCustomizeLevelDataSheet);
|
||||
var customizeBonusList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopCustomizeBonusData>(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<ShopCustomizeLevelData>(Const.ShopCustomizeLevelDataSheet);
|
||||
var level = customizeLevelList.LastOrDefault(data => data.point <= gameData.ShopCustomizePoint)?.level ?? 1;
|
||||
levelNotify.OnNext(level);
|
||||
gameData.ShopCustomizeLevel = level;
|
||||
GameDataManager.SaveGameData();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue