店舗レベルごとのレシピ開放対応
This commit is contained in:
parent
9b3af3217b
commit
b2cd3cf34c
|
|
@ -20,12 +20,13 @@ public class KitchenManager : MonoBehaviour
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Recipe);
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Recipe);
|
||||||
});
|
});
|
||||||
|
|
||||||
// スプレッドシート対応
|
|
||||||
// レシピIDが一覧で入っている
|
|
||||||
// データ
|
|
||||||
var gameData = GameDataManager.GameData;
|
var gameData = GameDataManager.GameData;
|
||||||
CoinManager.Instance.ChangeCoin(gameData.coin);
|
CoinManager.Instance.ChangeCoin(gameData.coin);
|
||||||
|
|
||||||
|
var shopLevelList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopLevelData>(Const.ShopLevelDataSheet);
|
||||||
|
HeartMeter.Instance.Initialize(shopLevelList);
|
||||||
|
HeartMeter.Instance.SetHeart(gameData.Heart);
|
||||||
|
|
||||||
SetData();
|
SetData();
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
|
|
@ -42,8 +43,6 @@ public class KitchenManager : MonoBehaviour
|
||||||
gameData.MyRecipes = new[]
|
gameData.MyRecipes = new[]
|
||||||
{
|
{
|
||||||
1,
|
1,
|
||||||
2,
|
|
||||||
13,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,31 +47,9 @@ public class Market : MonoBehaviour
|
||||||
var gameData = GameDataManager.GameData;
|
var gameData = GameDataManager.GameData;
|
||||||
CoinManager.Instance.ChangeCoin(gameData.coin);
|
CoinManager.Instance.ChangeCoin(gameData.coin);
|
||||||
|
|
||||||
var shopLevelList = new List<(int level, int heart, int tenMinCustomer)>
|
var shopLevelList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopLevelData>(Const.ShopLevelDataSheet);
|
||||||
{
|
var shopLevelToCustomerList = shopLevelList.Select(shopLevel => (level:shopLevel.shopLevel, tenMinCustomer:shopLevel.customer));
|
||||||
(1, 0, 10),
|
HeartMeter.Instance.Initialize(shopLevelList);
|
||||||
(2, 10, 15),
|
|
||||||
(3, 30, 20),
|
|
||||||
(4, 50, 25),
|
|
||||||
(5, 80, 30),
|
|
||||||
(6, 130, 35),
|
|
||||||
(7, 210, 40),
|
|
||||||
(8, 320, 45),
|
|
||||||
(9, 470, 50),
|
|
||||||
(10, 650, 55),
|
|
||||||
(11, 870, 60),
|
|
||||||
(12, 1120, 65),
|
|
||||||
(13, 1420, 70),
|
|
||||||
(14, 1870, 75),
|
|
||||||
(15, 2470, 80),
|
|
||||||
(16, 3170, 85),
|
|
||||||
(17, 4070, 90),
|
|
||||||
(18, 5470, 95),
|
|
||||||
(19, 7070, 100),
|
|
||||||
(20, 9070, 105),
|
|
||||||
};
|
|
||||||
|
|
||||||
HeartMeter.Instance.Initialize(shopLevelList.Select(x => x.heart).ToList());
|
|
||||||
HeartMeter.Instance.SetHeart(gameData.Heart);
|
HeartMeter.Instance.SetHeart(gameData.Heart);
|
||||||
|
|
||||||
// 在庫数表示
|
// 在庫数表示
|
||||||
|
|
@ -302,7 +280,7 @@ public class Market : MonoBehaviour
|
||||||
|
|
||||||
// お客さん出現タイマー(店舗レベル連動
|
// お客さん出現タイマー(店舗レベル連動
|
||||||
var changeCustomerFlowObservable = HeartMeter.Instance.ShopLevel
|
var changeCustomerFlowObservable = HeartMeter.Instance.ShopLevel
|
||||||
.Select(x => (float)60 * 10 / shopLevelList.First(y => y.level == x).tenMinCustomer); // 10分間期待値から来客の間隔を算出
|
.Select(x => (float)60 * 10 / shopLevelToCustomerList.First(y => y.level == x).tenMinCustomer); // 10分間期待値から来客の間隔を算出
|
||||||
var customerObservable = changeCustomerFlowObservable
|
var customerObservable = changeCustomerFlowObservable
|
||||||
.Select(x => Observable.Interval(TimeSpan.FromSeconds(x))
|
.Select(x => Observable.Interval(TimeSpan.FromSeconds(x))
|
||||||
.Select(_ =>
|
.Select(_ =>
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ public class HeartMeter : SingletonMonoBehaviour<HeartMeter>
|
||||||
compositeDisposable.AddTo(this);
|
compositeDisposable.AddTo(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialize(List<int> list)
|
public void Initialize(List<ShopLevelData> shopLevelDataList)
|
||||||
{
|
{
|
||||||
levelList = list;
|
levelList = shopLevelDataList.Select(shopLevelData => shopLevelData.heart).ToList();
|
||||||
compositeDisposable.Clear();
|
compositeDisposable.Clear();
|
||||||
shopLevel.Subscribe(x =>
|
shopLevel.Subscribe(x =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue