大量注文時レシピ/ゲームリザルト表示切り分け
This commit is contained in:
parent
3f4d423e85
commit
3ccec2b6a5
|
|
@ -1547,7 +1547,8 @@ RectTransform:
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children:
|
||||||
|
- {fileID: 5448093039945588035}
|
||||||
m_Father: {fileID: 357117903}
|
m_Father: {fileID: 357117903}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
|
@ -17444,6 +17445,131 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 9cd0f85cb815c374a913cf9c1a825d1b, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 9cd0f85cb815c374a913cf9c1a825d1b, type: 3}
|
||||||
|
--- !u!1001 &5448093039945588034
|
||||||
|
PrefabInstance:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 977215193}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Pivot.x
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Pivot.y
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_RootOrder
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchorMax.x
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchorMin.x
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchorMin.y
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_SizeDelta.x
|
||||||
|
value: 222
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_SizeDelta.y
|
||||||
|
value: 325
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5741585859577866755, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Name
|
||||||
|
value: package
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_SourcePrefab: {fileID: 100100000, guid: 7851d17bad9514d0cab3211e1e81bdda, type: 3}
|
||||||
|
--- !u!224 &5448093039945588035 stripped
|
||||||
|
RectTransform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 5431808858934536808, guid: 7851d17bad9514d0cab3211e1e81bdda,
|
||||||
|
type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 5448093039945588034}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!20 &6858317174449111712
|
--- !u!20 &6858317174449111712
|
||||||
Camera:
|
Camera:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ using UnityEngine.UI;
|
||||||
public class CookingResult : MonoBehaviour
|
public class CookingResult : MonoBehaviour
|
||||||
{
|
{
|
||||||
private static readonly string RarityTextFormat = "売値 +{0}% UP";
|
private static readonly string RarityTextFormat = "売値 +{0}% UP";
|
||||||
|
private static readonly string BulkOrderRarityTextFormat = "大成功ボーナス獲得";
|
||||||
private static readonly string QuantityTextFormat = "x{0}";
|
private static readonly string QuantityTextFormat = "x{0}";
|
||||||
[SerializeField] private GameObject smokeEffect;
|
[SerializeField] private GameObject smokeEffect;
|
||||||
[SerializeField] private GameObject glitterEffect;
|
[SerializeField] private GameObject glitterEffect;
|
||||||
|
|
@ -28,11 +29,17 @@ public class CookingResult : MonoBehaviour
|
||||||
[SerializeField] private GameObject goodResultObject;
|
[SerializeField] private GameObject goodResultObject;
|
||||||
[SerializeField] private GameObject failureResultObject;
|
[SerializeField] private GameObject failureResultObject;
|
||||||
|
|
||||||
|
ReactiveProperty<CornResult> result = new ReactiveProperty<CornResult>();
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
var (productData, rarityData, resultData, successAction) = LocalCacheManager.Load<(ProductData, RarityData, CornResult, Action)>(PopcornGameManager.CookingResultDataTag);
|
result.AddTo(this);
|
||||||
var result = new ReactiveProperty<CornResult>(resultData).AddTo(this);
|
|
||||||
SetData(productData, rarityData);
|
var viewType = LocalCacheManager.Load(Const.ProductViewTypeTag, ProductViewType.Default);
|
||||||
|
var productData = LocalCacheManager.Load<ProductData>(PopcornGameManager.CookingDataTag);
|
||||||
|
var (rarityData, resultData, successAction) = LocalCacheManager.Load<(RarityData, CornResult, Action)>(PopcornGameManager.CookingResultDataTag);
|
||||||
|
result.Value = resultData;
|
||||||
|
SetData(productData, rarityData, viewType);
|
||||||
result.Subscribe(r =>
|
result.Subscribe(r =>
|
||||||
{
|
{
|
||||||
SetUI(r, rarityData.Rarity != ProductRarity.Normal);
|
SetUI(r, rarityData.Rarity != ProductRarity.Normal);
|
||||||
|
|
@ -43,18 +50,47 @@ public class CookingResult : MonoBehaviour
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
||||||
// 各種ボタン押下後、獲得処理
|
// 各種ボタン押下後、獲得処理
|
||||||
centerOkButton.OnClickAsObservable().Subscribe(_ =>
|
if (viewType == ProductViewType.Default)
|
||||||
{
|
{
|
||||||
// 獲得、遷移
|
centerOkButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
AddStock(productData, rarityData.Rarity);
|
{
|
||||||
TransitionManager.Instance.LoadScene(GameScenes.Main);
|
// 獲得、遷移
|
||||||
}).AddTo(this);
|
AddStock(productData, rarityData.Rarity);
|
||||||
leftOkButton.OnClickAsObservable().Subscribe(_ =>
|
TransitionManager.Instance.LoadScene(GameScenes.Main);
|
||||||
|
}).AddTo(this);
|
||||||
|
leftOkButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
|
{
|
||||||
|
// 獲得、遷移
|
||||||
|
AddStock(productData);
|
||||||
|
TransitionManager.Instance.LoadScene(GameScenes.Main);
|
||||||
|
}).AddTo(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// 獲得、遷移
|
// 大量注文時処理
|
||||||
AddStock(productData);
|
var materialNumber = LocalCacheManager.Load<int>(BulkOrder.MaterialNumberTag);
|
||||||
TransitionManager.Instance.LoadScene(GameScenes.Main);
|
centerOkButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
}).AddTo(this);
|
{
|
||||||
|
// 獲得、遷移
|
||||||
|
if (GameDataManager.GameData.CompletedOrderList.Exists(data => data.Number != materialNumber))
|
||||||
|
{
|
||||||
|
GameDataManager.GameData.CompletedOrderList.Add(new BulkOrderResultData(){Number = materialNumber, Rarity = rarityData.Rarity});
|
||||||
|
GameDataManager.SaveGameData();
|
||||||
|
}
|
||||||
|
TransitionManager.Instance.LoadScene(GameScenes.Main);
|
||||||
|
}).AddTo(this);
|
||||||
|
leftOkButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
|
{
|
||||||
|
// 獲得、遷移
|
||||||
|
if (GameDataManager.GameData.CompletedOrderList.Exists(data => data.Number != materialNumber))
|
||||||
|
{
|
||||||
|
GameDataManager.GameData.CompletedOrderList.Add(new BulkOrderResultData(){Number = materialNumber, Rarity = ProductRarity.Normal});
|
||||||
|
GameDataManager.SaveGameData();
|
||||||
|
}
|
||||||
|
TransitionManager.Instance.LoadScene(GameScenes.Main);
|
||||||
|
}).AddTo(this);
|
||||||
|
}
|
||||||
|
|
||||||
perfectButton.OnClickAsObservable().Subscribe(_ =>
|
perfectButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
{
|
{
|
||||||
// 広告視聴後、結果上書き
|
// 広告視聴後、結果上書き
|
||||||
|
|
@ -67,13 +103,14 @@ public class CookingResult : MonoBehaviour
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetData(ProductData recipe, RarityData rarity)
|
private void SetData(ProductData recipe, RarityData rarity, ProductViewType viewType)
|
||||||
{
|
{
|
||||||
// popcornImage
|
// popcornImage
|
||||||
popcornText.text = recipe.name;
|
popcornText.text = recipe.name;
|
||||||
popcornTextPerfect.text = recipe.name;
|
popcornTextPerfect.text = recipe.name;
|
||||||
quantityText.text = string.Format(QuantityTextFormat, recipe.volume);
|
quantityText.text = string.Format(QuantityTextFormat, recipe.volume);
|
||||||
rarityText.text = string.Format(RarityTextFormat, rarity.rate - 100);
|
var rarityFormat = viewType == ProductViewType.Default ? RarityTextFormat : BulkOrderRarityTextFormat;
|
||||||
|
rarityText.text = string.Format(rarityFormat, rarity.rate - 100);
|
||||||
rarityView.SetRarity(rarity.Rarity);
|
rarityView.SetRarity(rarity.Rarity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,8 +103,12 @@ public class PopcornGameManager : MonoBehaviour
|
||||||
|
|
||||||
private void ResetGame()
|
private void ResetGame()
|
||||||
{
|
{
|
||||||
// フライパン設定
|
var panList = SpreadsheetDataManager.Instance.GetBaseDataList<PanData>(Const.PanDataSheet);
|
||||||
var panData = LocalCacheManager.Load<PanData>(PanDataTag);
|
var panData = LocalCacheManager.Load<PanData>(PanDataTag);
|
||||||
|
var rarityList = SpreadsheetDataManager.Instance.GetBaseDataList<RarityData>(Const.RarityDataSheet);
|
||||||
|
var rarityData = rarityList.First(data => data.Rarity == panData.Rarity);
|
||||||
|
// フライパン設定
|
||||||
|
// setPanData();
|
||||||
cornManager.SetCornsActive(true);
|
cornManager.SetCornsActive(true);
|
||||||
compositeDisposable.Clear();
|
compositeDisposable.Clear();
|
||||||
cornManager.Result.SkipLatestValueOnSubscribe()
|
cornManager.Result.SkipLatestValueOnSubscribe()
|
||||||
|
|
@ -116,10 +120,7 @@ public class PopcornGameManager : MonoBehaviour
|
||||||
// リザルト表示遅延
|
// リザルト表示遅延
|
||||||
this.CallWaitForSeconds(1.2f, () =>
|
this.CallWaitForSeconds(1.2f, () =>
|
||||||
{
|
{
|
||||||
var rarityList = SpreadsheetDataManager.Instance.GetBaseDataList<RarityData>(Const.RarityDataSheet);
|
LocalCacheManager.Save(CookingResultDataTag, (rarityData, result, new Action(() => cornManager.SetCornsActive(false))));
|
||||||
var rarityData = rarityList.First(data => data.Rarity == panData.Rarity);
|
|
||||||
var productData = LocalCacheManager.Load<ProductData>(CookingDataTag);
|
|
||||||
LocalCacheManager.Save(CookingResultDataTag, (productData, rarityData, result, new Action(() => cornManager.SetCornsActive(false))));
|
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.CookingResults);
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.CookingResults);
|
||||||
});
|
});
|
||||||
}).AddTo(compositeDisposable);
|
}).AddTo(compositeDisposable);
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ public class KitchenManager : MonoBehaviour
|
||||||
// レシピの表示
|
// レシピの表示
|
||||||
cookingButton.OnClickAsObservable().Subscribe(_ =>
|
cookingButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
{
|
{
|
||||||
|
LocalCacheManager.Remove(Const.ProductViewTypeTag);
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Recipe);
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Recipe);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -84,6 +85,7 @@ public class KitchenManager : MonoBehaviour
|
||||||
orderIndicatorView.SetIndicate(false, false);
|
orderIndicatorView.SetIndicate(false, false);
|
||||||
orderIndicatorView.TappedPhone.ThrottleFirst(TimeSpan.FromSeconds(1f)).Subscribe(__ =>
|
orderIndicatorView.TappedPhone.ThrottleFirst(TimeSpan.FromSeconds(1f)).Subscribe(__ =>
|
||||||
{
|
{
|
||||||
|
LocalCacheManager.Remove(Const.ProductViewTypeTag);
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrder);
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrder);
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
@ -96,6 +98,7 @@ public class KitchenManager : MonoBehaviour
|
||||||
.ThrottleFirst(TimeSpan.FromSeconds(1f))
|
.ThrottleFirst(TimeSpan.FromSeconds(1f))
|
||||||
.Subscribe(_ =>
|
.Subscribe(_ =>
|
||||||
{
|
{
|
||||||
|
LocalCacheManager.Remove(Const.ProductViewTypeTag);
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrder);
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrder);
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -965,8 +965,8 @@ PrefabInstance:
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: [{fileID: 2260898471005442077, guid: 434f6174871f2dc4992321e9d579f138,
|
m_RemovedComponents:
|
||||||
type: 3}]
|
- {fileID: 2260898471005442077, guid: 434f6174871f2dc4992321e9d579f138, type: 3}
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 434f6174871f2dc4992321e9d579f138, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 434f6174871f2dc4992321e9d579f138, type: 3}
|
||||||
--- !u!224 &670639509 stripped
|
--- !u!224 &670639509 stripped
|
||||||
RectTransform:
|
RectTransform:
|
||||||
|
|
@ -974,6 +974,11 @@ RectTransform:
|
||||||
type: 3}
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 670639508}
|
m_PrefabInstance: {fileID: 670639508}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!4 &670639510 stripped
|
||||||
|
Transform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 670639508}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1 &679566761
|
--- !u!1 &679566761
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -1797,6 +1802,8 @@ MonoBehaviour:
|
||||||
panSelector: {fileID: 1160535648}
|
panSelector: {fileID: 1160535648}
|
||||||
flavorName: {fileID: 707887860}
|
flavorName: {fileID: 707887860}
|
||||||
flavorPrice: {fileID: 498799267}
|
flavorPrice: {fileID: 498799267}
|
||||||
|
flavorVolume: {fileID: 1497671330}
|
||||||
|
flavorVolumeObject: {fileID: 878944767}
|
||||||
flavorStock: {fileID: 1109202679}
|
flavorStock: {fileID: 1109202679}
|
||||||
flavorText: {fileID: 1116792172}
|
flavorText: {fileID: 1116792172}
|
||||||
flavorImageTarget: {fileID: 1826815494}
|
flavorImageTarget: {fileID: 1826815494}
|
||||||
|
|
@ -2945,7 +2952,8 @@ RectTransform:
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: [{fileID: 670639509}]
|
m_Children:
|
||||||
|
- {fileID: 670639510}
|
||||||
m_Father: {fileID: 230185243}
|
m_Father: {fileID: 230185243}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
|
@ -3358,7 +3366,8 @@ RectTransform:
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: [{fileID: 1971927379}]
|
m_Children:
|
||||||
|
- {fileID: 1971927379}
|
||||||
m_Father: {fileID: 1626721124}
|
m_Father: {fileID: 1626721124}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
|
@ -3487,6 +3496,22 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1853630202}
|
m_GameObject: {fileID: 1853630202}
|
||||||
m_CullTransparentMesh: 0
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!114 &1853630207
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1853630202}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 5e732834936f04d48be0ff3fa358563d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
onClickPlaySEFilename: se_ButtonTap
|
||||||
|
randomPlaySEFilenames: []
|
||||||
|
randomPlayVoiceFilenames: []
|
||||||
|
vibrationType: 0
|
||||||
--- !u!1 &1971927378
|
--- !u!1 &1971927378
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -3561,22 +3586,6 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1971927378}
|
m_GameObject: {fileID: 1971927378}
|
||||||
m_CullTransparentMesh: 0
|
m_CullTransparentMesh: 0
|
||||||
--- !u!114 &1853630207
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1853630202}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 5e732834936f04d48be0ff3fa358563d, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
onClickPlaySEFilename: se_ButtonTap
|
|
||||||
randomPlaySEFilenames: []
|
|
||||||
randomPlayVoiceFilenames: []
|
|
||||||
vibrationType: 0
|
|
||||||
--- !u!1 &1972550997
|
--- !u!1 &1972550997
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
[SerializeField] private PanSelector panSelector;
|
[SerializeField] private PanSelector panSelector;
|
||||||
[SerializeField] private Text flavorName;
|
[SerializeField] private Text flavorName;
|
||||||
[SerializeField] private Text flavorPrice;
|
[SerializeField] private Text flavorPrice;
|
||||||
|
[SerializeField] private Text flavorVolume;
|
||||||
|
[SerializeField] private GameObject flavorVolumeObject;
|
||||||
[SerializeField] private Text flavorStock;
|
[SerializeField] private Text flavorStock;
|
||||||
[SerializeField] private Text flavorText;
|
[SerializeField] private Text flavorText;
|
||||||
[SerializeField] private Transform flavorImageTarget;
|
[SerializeField] private Transform flavorImageTarget;
|
||||||
|
|
@ -32,6 +34,7 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
var viewType = LocalCacheManager.Load(Const.ProductViewTypeTag, ProductViewType.Default);
|
||||||
var data = LocalCacheManager.Load<ProductData>(PopcornGameManager.CookingDataTag);
|
var data = LocalCacheManager.Load<ProductData>(PopcornGameManager.CookingDataTag);
|
||||||
|
|
||||||
cancelButton.OnClickAsObservable().Subscribe(_ =>
|
cancelButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
|
|
@ -62,7 +65,7 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
TransitionManager.Instance.LoadScene(GameScenes.Cooking);
|
TransitionManager.Instance.LoadScene(GameScenes.Cooking);
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
||||||
SetRecipe(data);
|
SetRecipe(data, viewType);
|
||||||
var isPassedAmount = CheckAmount(data);
|
var isPassedAmount = CheckAmount(data);
|
||||||
var isPassedTank = CheckTank(data);
|
var isPassedTank = CheckTank(data);
|
||||||
nextButton.interactable = isPassedAmount && isPassedTank;
|
nextButton.interactable = isPassedAmount && isPassedTank;
|
||||||
|
|
@ -71,7 +74,7 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
tankCaution.SetActive(isPassedAmount && !isPassedTank);
|
tankCaution.SetActive(isPassedAmount && !isPassedTank);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetRecipe(ProductData data)
|
public void SetRecipe(ProductData data, ProductViewType viewType)
|
||||||
{
|
{
|
||||||
var gameData = GameDataManager.GameData;
|
var gameData = GameDataManager.GameData;
|
||||||
|
|
||||||
|
|
@ -81,10 +84,27 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
flavorStock.text = string.Format(flavorStockFormat, shopStock + tankStock);
|
flavorStock.text = string.Format(flavorStockFormat, shopStock + tankStock);
|
||||||
flavorName.text = data.name;
|
flavorName.text = data.name;
|
||||||
flavorPrice.text = data.price.ToString();
|
flavorPrice.text = data.price.ToString();
|
||||||
|
flavorVolume.text = data.volume.ToString();
|
||||||
flavorText.text = data.text;
|
flavorText.text = data.text;
|
||||||
flavorImageTarget.DestroyAllChildrens();
|
flavorImageTarget.DestroyAllChildrens();
|
||||||
Instantiate(data.GetIconPrefab(), flavorImageTarget);
|
Instantiate(data.GetIconPrefab(), flavorImageTarget);
|
||||||
cornAmountText.text = string.Format(cornAmountFormat, gameData.CornSeed, data.MaterialList[0].amount);
|
cornAmountText.text = string.Format(cornAmountFormat, gameData.CornSeed, data.MaterialList[0].amount);
|
||||||
|
|
||||||
|
switch (viewType)
|
||||||
|
{
|
||||||
|
case ProductViewType.Default:
|
||||||
|
flavorVolumeObject.SetActive(true);
|
||||||
|
flavorPrice.transform.parent.gameObject.SetActive(true);
|
||||||
|
flavorVolume.transform.parent.gameObject.SetActive(false);
|
||||||
|
break;
|
||||||
|
case ProductViewType.BulkOrder:
|
||||||
|
flavorVolumeObject.SetActive(false);
|
||||||
|
flavorPrice.transform.parent.gameObject.SetActive(false);
|
||||||
|
flavorVolume.transform.parent.gameObject.SetActive(true);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(viewType), viewType, null);
|
||||||
|
}
|
||||||
|
|
||||||
var shopData = SpreadsheetDataManager.Instance.GetBaseDataList<ShopData>(Const.ShopDataSheet);
|
var shopData = SpreadsheetDataManager.Instance.GetBaseDataList<ShopData>(Const.ShopDataSheet);
|
||||||
var flavor1Amount = gameData.Material.FirstOrDefault(x => x.Id == data.MaterialList[1].id)?.Amount ?? 0;
|
var flavor1Amount = gameData.Material.FirstOrDefault(x => x.Id == data.MaterialList[1].id)?.Amount ?? 0;
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ public static class Const {
|
||||||
public static readonly string VibrationTag = "Vibration";
|
public static readonly string VibrationTag = "Vibration";
|
||||||
public static readonly string LanguageDataTypeTag = "LanguageDataType";
|
public static readonly string LanguageDataTypeTag = "LanguageDataType";
|
||||||
public static readonly string LocalNotificationTag = "LocalNotification";
|
public static readonly string LocalNotificationTag = "LocalNotification";
|
||||||
|
public static readonly string ProductViewTypeTag = "ProductViewType";
|
||||||
|
|
||||||
// sns
|
// sns
|
||||||
public static readonly string LineURL = "http://nav.cx/aVZ8nEK";
|
public static readonly string LineURL = "http://nav.cx/aVZ8nEK";
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,12 @@ public enum CornFieldUpgradeType
|
||||||
Machine = 4,
|
Machine = 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum ProductViewType
|
||||||
|
{
|
||||||
|
Default = 1,
|
||||||
|
BulkOrder = 2,
|
||||||
|
}
|
||||||
|
|
||||||
public enum MissionCategory
|
public enum MissionCategory
|
||||||
{
|
{
|
||||||
Normal = 1,
|
Normal = 1,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue