Merge branch 'develop' of bitbucket.org:usaya/popcorn into develop
This commit is contained in:
commit
77d397312c
|
|
@ -1490,12 +1490,12 @@ PrefabInstance:
|
||||||
- target: {fileID: 5062447477614030396, guid: f19992fe2069b4e16b2f83277fb189cb,
|
- target: {fileID: 5062447477614030396, guid: f19992fe2069b4e16b2f83277fb189cb,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_Text
|
propertyPath: m_Text
|
||||||
value: "\u7D20\u6750\n\u88DC\u5145"
|
value: "\u7D20\u6750\u30EA\n\u30BB\u30C3\u30C8"
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5850834825256791800, guid: f19992fe2069b4e16b2f83277fb189cb,
|
- target: {fileID: 5850834825256791800, guid: f19992fe2069b4e16b2f83277fb189cb,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: RefillButton
|
value: ResetMaterialButton
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5850834825256791800, guid: f19992fe2069b4e16b2f83277fb189cb,
|
- target: {fileID: 5850834825256791800, guid: f19992fe2069b4e16b2f83277fb189cb,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
|
@ -1548,7 +1548,7 @@ MonoBehaviour:
|
||||||
resetButton: {fileID: 785180941}
|
resetButton: {fileID: 785180941}
|
||||||
backButton: {fileID: 785180940}
|
backButton: {fileID: 785180940}
|
||||||
resetFieldButton: {fileID: 450754452}
|
resetFieldButton: {fileID: 450754452}
|
||||||
refillMaterialButton: {fileID: 1767352104}
|
resetMaterialButton: {fileID: 1767352104}
|
||||||
refillManyProductButton: {fileID: 1651104560}
|
refillManyProductButton: {fileID: 1651104560}
|
||||||
refillLittleProductButton: {fileID: 153639484}
|
refillLittleProductButton: {fileID: 153639484}
|
||||||
fastGrowingToggle: {fileID: 1998240841}
|
fastGrowingToggle: {fileID: 1998240841}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ public class DebugOptionManager : MonoBehaviour
|
||||||
[SerializeField] private Button resetButton;
|
[SerializeField] private Button resetButton;
|
||||||
[SerializeField] private Button backButton;
|
[SerializeField] private Button backButton;
|
||||||
[SerializeField] private Button resetFieldButton;
|
[SerializeField] private Button resetFieldButton;
|
||||||
[SerializeField] private Button refillMaterialButton;
|
[SerializeField] private Button resetMaterialButton;
|
||||||
[SerializeField] private Button refillManyProductButton;
|
[SerializeField] private Button refillManyProductButton;
|
||||||
[SerializeField] private Button refillLittleProductButton;
|
[SerializeField] private Button refillLittleProductButton;
|
||||||
[SerializeField] private Toggle fastGrowingToggle;
|
[SerializeField] private Toggle fastGrowingToggle;
|
||||||
|
|
@ -46,13 +46,18 @@ public class DebugOptionManager : MonoBehaviour
|
||||||
gameData.SeedlingDataList = null;
|
gameData.SeedlingDataList = null;
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
||||||
refillMaterialButton.OnClickAsObservable().Subscribe(_ =>
|
resetMaterialButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
{
|
{
|
||||||
// 所持素材
|
// 所持素材
|
||||||
|
gameData.Material = new List<MaterialData>{new MaterialData{Id = 2}};
|
||||||
foreach (var material in gameData.Material)
|
foreach (var material in gameData.Material)
|
||||||
{
|
{
|
||||||
material.Amount = 10;
|
material.Amount = 5;
|
||||||
}
|
}
|
||||||
|
// レシピ
|
||||||
|
gameData.MyRecipes = new[] {1, 2, 13};
|
||||||
|
// フライパン
|
||||||
|
gameData.Pans = new[] {Const.DefaultPanId};
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
||||||
refillManyProductButton.OnClickAsObservable().Subscribe(_ =>
|
refillManyProductButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,15 @@ public class KitchenManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
var gameData = GameDataManager.GameData;
|
var gameData = GameDataManager.GameData;
|
||||||
// 所持レシピ
|
// 所持レシピ
|
||||||
gameData.MyRecipes = new[]
|
if (gameData.MyRecipes == null || gameData.MyRecipes.Length == 0)
|
||||||
{
|
{
|
||||||
1,
|
gameData.MyRecipes = new[]
|
||||||
2,
|
{
|
||||||
13,
|
1,
|
||||||
};
|
2,
|
||||||
|
13,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// 所持素材
|
// 所持素材
|
||||||
if (gameData.Material == null || gameData.Material.Count == 0)
|
if (gameData.Material == null || gameData.Material.Count == 0)
|
||||||
|
|
|
||||||
|
|
@ -5,20 +5,7 @@ using UnityEngine.UI;
|
||||||
|
|
||||||
public class ProductManagement : MonoBehaviour
|
public class ProductManagement : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static readonly string PrevSceneNameTag = "ProductManagementPrevSceneName";
|
|
||||||
|
|
||||||
[SerializeField] private Button prevButton;
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
var prevGameScene = GameScenes.Main;
|
|
||||||
if (LocalCacheManager.Exists(PrevSceneNameTag))
|
|
||||||
{
|
|
||||||
prevGameScene = LocalCacheManager.Load<GameScenes>(PrevSceneNameTag);
|
|
||||||
}
|
|
||||||
prevButton.OnClickAsObservable().Subscribe(_ =>
|
|
||||||
{
|
|
||||||
TransitionManager.Instance.LoadScene(prevGameScene);
|
|
||||||
}).AddTo(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -277,6 +277,7 @@ MonoBehaviour:
|
||||||
name: {fileID: 9133304336883555433}
|
name: {fileID: 9133304336883555433}
|
||||||
icon: {fileID: 9133304335605570096}
|
icon: {fileID: 9133304335605570096}
|
||||||
price: {fileID: 9133304336128604254}
|
price: {fileID: 9133304336128604254}
|
||||||
|
text: {fileID: 9133304336181127572}
|
||||||
stockCount: {fileID: 9133304336153810480}
|
stockCount: {fileID: 9133304336153810480}
|
||||||
totalPrice: {fileID: 9133304335494687832}
|
totalPrice: {fileID: 9133304335494687832}
|
||||||
purchaseCount: {fileID: 9133304336756314526}
|
purchaseCount: {fileID: 9133304336756314526}
|
||||||
|
|
@ -285,6 +286,8 @@ MonoBehaviour:
|
||||||
closeButton: {fileID: 9133304335940276437}
|
closeButton: {fileID: 9133304335940276437}
|
||||||
purchaseOnButton: {fileID: 9133304335268316946}
|
purchaseOnButton: {fileID: 9133304335268316946}
|
||||||
purchaseOffButton: {fileID: 7845949066005219734}
|
purchaseOffButton: {fileID: 7845949066005219734}
|
||||||
|
quantitySelectObject: {fileID: 9133304337054428179}
|
||||||
|
explanationObject: {fileID: 9133304336181127570}
|
||||||
--- !u!1 &9133304335268316944
|
--- !u!1 &9133304335268316944
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using UnityEngine.UI;
|
||||||
public class ShopItemPurchaseView : MonoBehaviour
|
public class ShopItemPurchaseView : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static readonly string ItemPurchaseTag = "ItemPurcahse";
|
public static readonly string ItemPurchaseTag = "ItemPurcahse";
|
||||||
|
private static readonly string redColorString= "#fb6346";
|
||||||
private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger");
|
private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger");
|
||||||
private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger");
|
private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger");
|
||||||
private static readonly int MaxPurchaseCount = 999;
|
private static readonly int MaxPurchaseCount = 999;
|
||||||
|
|
@ -15,6 +16,7 @@ public class ShopItemPurchaseView : MonoBehaviour
|
||||||
[SerializeField] private Text name;
|
[SerializeField] private Text name;
|
||||||
[SerializeField] private Transform icon;
|
[SerializeField] private Transform icon;
|
||||||
[SerializeField] private Text price;
|
[SerializeField] private Text price;
|
||||||
|
[SerializeField] private Text text;
|
||||||
[SerializeField] private Text stockCount;
|
[SerializeField] private Text stockCount;
|
||||||
[SerializeField] private Text totalPrice;
|
[SerializeField] private Text totalPrice;
|
||||||
[SerializeField] private Text purchaseCount;
|
[SerializeField] private Text purchaseCount;
|
||||||
|
|
@ -23,13 +25,18 @@ public class ShopItemPurchaseView : MonoBehaviour
|
||||||
[SerializeField] private Button closeButton;
|
[SerializeField] private Button closeButton;
|
||||||
[SerializeField] private Button purchaseOnButton;
|
[SerializeField] private Button purchaseOnButton;
|
||||||
[SerializeField] private GameObject purchaseOffButton;
|
[SerializeField] private GameObject purchaseOffButton;
|
||||||
|
[SerializeField] private GameObject quantitySelectObject;
|
||||||
|
[SerializeField] private GameObject explanationObject;
|
||||||
|
|
||||||
|
private Color redColor;
|
||||||
private Color defaultColor;
|
private Color defaultColor;
|
||||||
private readonly IntReactiveProperty currentCount = new IntReactiveProperty();
|
private readonly IntReactiveProperty currentCount = new IntReactiveProperty();
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
currentCount.AddTo(this);
|
currentCount.AddTo(this);
|
||||||
defaultColor = totalPrice.color;
|
defaultColor = totalPrice.color;
|
||||||
|
ColorUtility.TryParseHtmlString(redColorString, out redColor);
|
||||||
|
// 表示データを受け取る
|
||||||
var data = LocalCacheManager.Load<(ShopData shopData, int stockCount, Action<int> callback)>(ItemPurchaseTag);
|
var data = LocalCacheManager.Load<(ShopData shopData, int stockCount, Action<int> callback)>(ItemPurchaseTag);
|
||||||
LocalCacheManager.Remove(ItemPurchaseTag);
|
LocalCacheManager.Remove(ItemPurchaseTag);
|
||||||
SetData(data.shopData, data.stockCount);
|
SetData(data.shopData, data.stockCount);
|
||||||
|
|
@ -58,10 +65,12 @@ public class ShopItemPurchaseView : MonoBehaviour
|
||||||
{
|
{
|
||||||
var total = data.shopData.price * x;
|
var total = data.shopData.price * x;
|
||||||
SetButtonActive(total <= CoinManager.Instance.OwnCoin);
|
SetButtonActive(total <= CoinManager.Instance.OwnCoin);
|
||||||
totalPrice.color = total <= CoinManager.Instance.OwnCoin ? defaultColor : Color.red;
|
totalPrice.color = total <= CoinManager.Instance.OwnCoin ? defaultColor : redColor;
|
||||||
totalPrice.text = $"{total}";
|
totalPrice.text = $"{total}";
|
||||||
purchaseCount.text = $"{x}";
|
purchaseCount.text = $"{x}";
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
quantitySelectObject.SetActive(data.shopData.ConsumeType == ShopItemType.Consumable);
|
||||||
|
explanationObject.SetActive(data.shopData.ConsumeType == ShopItemType.NonConsumable);
|
||||||
if (data.shopData.ConsumeType == ShopItemType.Consumable)
|
if (data.shopData.ConsumeType == ShopItemType.Consumable)
|
||||||
{
|
{
|
||||||
addCountButton.OnClickAsObservable().Select(_ => 1)
|
addCountButton.OnClickAsObservable().Select(_ => 1)
|
||||||
|
|
@ -82,6 +91,7 @@ public class ShopItemPurchaseView : MonoBehaviour
|
||||||
name.text = shopData.name;
|
name.text = shopData.name;
|
||||||
price.text = $"{shopData.price}";
|
price.text = $"{shopData.price}";
|
||||||
stockCount.text = $"所持数 :{count}";
|
stockCount.text = $"所持数 :{count}";
|
||||||
|
text.text = shopData.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetButtonActive(bool active)
|
private void SetButtonActive(bool active)
|
||||||
|
|
|
||||||
|
|
@ -46,15 +46,7 @@ public class ShopListView : MonoBehaviour
|
||||||
index = tabs.Count;
|
index = tabs.Count;
|
||||||
tabs.Add((tabCategory, Instantiate(scrollRect.content, scrollRect.content.parent)));
|
tabs.Add((tabCategory, Instantiate(scrollRect.content, scrollRect.content.parent)));
|
||||||
}
|
}
|
||||||
var itemView = Instantiate(itemViewPrefab, tabs[index].content);
|
return Instantiate(itemViewPrefab, tabs[index].content);
|
||||||
itemView.SetData(shopData);
|
|
||||||
// show detail view
|
|
||||||
itemView.DetailButtonObservable.Subscribe(_ =>
|
|
||||||
{
|
|
||||||
LocalCacheManager.Save(ShopItemDetailView.ItemDetailTag, shopData);
|
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.ShoppingExplanation);
|
|
||||||
}).AddTo(itemView);
|
|
||||||
return itemView;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemCategory GetTabCategory(ItemCategory category)
|
private ItemCategory GetTabCategory(ItemCategory category)
|
||||||
|
|
|
||||||
|
|
@ -9,18 +9,21 @@ public class Shopping : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] private ShopListView listView;
|
[SerializeField] private ShopListView listView;
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
|
private Subject<int> changeCoinSubject = new Subject<int>();
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
changeCoinSubject.AddTo(this);
|
||||||
|
|
||||||
var gameData = GameDataManager.GameData;
|
var gameData = GameDataManager.GameData;
|
||||||
CoinManager.Instance.ChangeCoin(gameData.coin);
|
CoinManager.Instance.ChangeCoin(gameData.coin);
|
||||||
HeartMeter.Instance.SetHeart(gameData.Heart);
|
HeartMeter.Instance.SetHeart(gameData.Heart);
|
||||||
var changeCoinSubject = new Subject<int>().AddTo(this);
|
|
||||||
|
|
||||||
// 一覧データ
|
// 一覧データ
|
||||||
var shopDataList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopData>(Const.ShopDataSheet);
|
var shopDataList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopData>(Const.ShopDataSheet);
|
||||||
foreach (var shopData in shopDataList)
|
foreach (var shopData in shopDataList)
|
||||||
{
|
{
|
||||||
var itemView = listView.AddItemView(shopData);
|
var itemView = listView.AddItemView(shopData);
|
||||||
|
itemView.SetData(shopData);
|
||||||
itemView.SetStockCount(GetItemAmount(shopData));
|
itemView.SetStockCount(GetItemAmount(shopData));
|
||||||
// コインを監視して購入可能状態を切り替え
|
// コインを監視して購入可能状態を切り替え
|
||||||
changeCoinSubject.Subscribe(ownCoin =>
|
changeCoinSubject.Subscribe(ownCoin =>
|
||||||
|
|
@ -47,6 +50,12 @@ public class Shopping : MonoBehaviour
|
||||||
LocalCacheManager.Save(ShopItemPurchaseView.ItemPurchaseTag, (shopData, GetItemAmount(shopData), new Action<int>(x => purchaseSubject.OnNext(x))));
|
LocalCacheManager.Save(ShopItemPurchaseView.ItemPurchaseTag, (shopData, GetItemAmount(shopData), new Action<int>(x => purchaseSubject.OnNext(x))));
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Purchase);
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Purchase);
|
||||||
}).AddTo(itemView);
|
}).AddTo(itemView);
|
||||||
|
// show detail view
|
||||||
|
itemView.DetailButtonObservable.Subscribe(_ =>
|
||||||
|
{
|
||||||
|
LocalCacheManager.Save(ShopItemDetailView.ItemDetailTag, shopData);
|
||||||
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.ShoppingExplanation);
|
||||||
|
}).AddTo(itemView);
|
||||||
}
|
}
|
||||||
changeCoinSubject.OnNext(CoinManager.Instance.OwnCoin);
|
changeCoinSubject.OnNext(CoinManager.Instance.OwnCoin);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ public class FooterManager : MonoBehaviour
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
productManagementButton.BindToOnClick(shareGate, _ =>
|
productManagementButton.BindToOnClick(shareGate, _ =>
|
||||||
{
|
{
|
||||||
LocalCacheManager.Save(ProductManagement.PrevSceneNameTag, Enum.Parse(typeof(GameScenes), gameObject.scene.name));
|
|
||||||
TransitionManager.Instance.LoadScene(GameScenes.ProductManagement);
|
TransitionManager.Instance.LoadScene(GameScenes.ProductManagement);
|
||||||
return Observable.Timer(TimeSpan.FromSeconds(.5f)).AsUnitObservable();
|
return Observable.Timer(TimeSpan.FromSeconds(.5f)).AsUnitObservable();
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue