Merge branch 'develop' of bitbucket.org:usaya/popcorn into develop
This commit is contained in:
commit
19bb735f10
|
|
@ -1867,6 +1867,8 @@ MonoBehaviour:
|
||||||
cancelButton: {fileID: 843133640}
|
cancelButton: {fileID: 843133640}
|
||||||
nextButton: {fileID: 1853630204}
|
nextButton: {fileID: 1853630204}
|
||||||
disabledNextButton: {fileID: 1037294270}
|
disabledNextButton: {fileID: 1037294270}
|
||||||
|
tankCaution: {fileID: 1464412873}
|
||||||
|
panSelector: {fileID: 1160535648}
|
||||||
flavorName: {fileID: 707887860}
|
flavorName: {fileID: 707887860}
|
||||||
flavorPrice: {fileID: 498799267}
|
flavorPrice: {fileID: 498799267}
|
||||||
flavorStock: {fileID: 1109202679}
|
flavorStock: {fileID: 1109202679}
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,16 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
{
|
{
|
||||||
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 string flavorStockFormat = "所持数 :{0}";
|
||||||
|
private static readonly string cornAmountFormat = "{0}/{1}";
|
||||||
|
private static readonly string flavorAmountFormat = "{0} / {1}";
|
||||||
|
|
||||||
[SerializeField] private Animator backgroundAnimator;
|
[SerializeField] private Animator backgroundAnimator;
|
||||||
[SerializeField] private Button cancelButton;
|
[SerializeField] private Button cancelButton;
|
||||||
[SerializeField] private Button nextButton;
|
[SerializeField] private Button nextButton;
|
||||||
[SerializeField] private GameObject disabledNextButton;
|
[SerializeField] private GameObject disabledNextButton;
|
||||||
|
[SerializeField] private GameObject tankCaution;
|
||||||
|
[SerializeField] private PanSelector panSelector;
|
||||||
[SerializeField] private Text flavorName;
|
[SerializeField] private Text flavorName;
|
||||||
[SerializeField] private Text flavorPrice;
|
[SerializeField] private Text flavorPrice;
|
||||||
[SerializeField] private Text flavorStock;
|
[SerializeField] private Text flavorStock;
|
||||||
|
|
@ -21,9 +25,6 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
[SerializeField] private Text flavor1AmountText;
|
[SerializeField] private Text flavor1AmountText;
|
||||||
[SerializeField] private Text flavor2AmountText;
|
[SerializeField] private Text flavor2AmountText;
|
||||||
[SerializeField] private GameObject flavor2View;
|
[SerializeField] private GameObject flavor2View;
|
||||||
private static readonly string flavorStockFormat = "所持数 :{0}";
|
|
||||||
private static readonly string cornAmountFormat = "{0}/{1}";
|
|
||||||
private static readonly string flavorAmountFormat = "{0} / {1}";
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
|
@ -39,10 +40,6 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
});
|
});
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
||||||
SetRecipe(data);
|
|
||||||
if (CheckAmount(data))
|
|
||||||
{
|
|
||||||
disabledNextButton.SetActive(false);
|
|
||||||
nextButton.OnClickAsObservable().Subscribe(_ =>
|
nextButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
{
|
{
|
||||||
var gameData = GameDataManager.GameData;
|
var gameData = GameDataManager.GameData;
|
||||||
|
|
@ -62,12 +59,14 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
GameDataManager.SaveGameData();
|
GameDataManager.SaveGameData();
|
||||||
TransitionManager.Instance.LoadScene(GameScenes.Cooking);
|
TransitionManager.Instance.LoadScene(GameScenes.Cooking);
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
}
|
|
||||||
else
|
SetRecipe(data);
|
||||||
{
|
var isPassedAmount = CheckAmount(data);
|
||||||
nextButton.interactable = false;
|
var isPassedTank = CheckTank(data);
|
||||||
disabledNextButton.SetActive(true);
|
nextButton.interactable = isPassedAmount && isPassedTank;
|
||||||
}
|
panSelector.gameObject.SetActive(isPassedTank);
|
||||||
|
disabledNextButton.SetActive(!isPassedAmount || !isPassedTank);
|
||||||
|
tankCaution.SetActive(!isPassedTank);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetRecipe(RecipeData data)
|
public void SetRecipe(RecipeData data)
|
||||||
|
|
@ -132,35 +131,21 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
flavor2AmountText.color = Color.red;
|
flavor2AmountText.color = Color.red;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return flag;
|
||||||
if (!flag)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 店頭の空きがない
|
private bool CheckTank(RecipeData data)
|
||||||
// 店頭の空きに追加
|
{
|
||||||
if (Market.ShopStockCount >= gameData.ShopStock.Count + data.Volume)
|
var gameData = GameDataManager.GameData;
|
||||||
|
// 店頭の空き確認
|
||||||
|
if (data.Volume <= Market.ShopStockCount - gameData.ShopStock.Count)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// 空のタンクに追加
|
|
||||||
if (gameData.StorageTanks.FindIndex(x => x.Stock == 0) != -1)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// 同じフレーバーのタンクを確認
|
|
||||||
var index = gameData.StorageTanks.FindIndex(x => x.FlavorId == data.RecipeId);
|
|
||||||
if (index != -1)
|
|
||||||
{
|
|
||||||
// 同じフレーバーのタンクの空きに追加
|
|
||||||
var tank = gameData.StorageTanks[index];
|
|
||||||
if (tank.Capacity >= tank.Stock + data.Volume)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
// 空のタンク、同じフレーバーのタンク空き確認
|
||||||
|
return gameData.StorageTanks
|
||||||
|
.Where(tank => tank.IsEmpty || tank.FlavorId == data.RecipeId && !tank.IsFull)
|
||||||
|
.Any(tank => data.Volume <= tank.Capacity - tank.Stock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ using UnityEngine.UI;
|
||||||
|
|
||||||
public class RecipeSelectDialog : MonoBehaviour
|
public class RecipeSelectDialog : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] private GameObject content;
|
[SerializeField] private ScrollRect scrollRect;
|
||||||
[SerializeField] private RecipeView recipePrefab;
|
[SerializeField] private RecipeView recipePrefab;
|
||||||
[SerializeField] private Button closeButton;
|
[SerializeField] private Button closeButton;
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
|
|
@ -19,6 +19,7 @@ public class RecipeSelectDialog : MonoBehaviour
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
||||||
// レシピ一覧生成
|
// レシピ一覧生成
|
||||||
|
var content = scrollRect.content;
|
||||||
content.transform.DestroyAllChildrens();
|
content.transform.DestroyAllChildrens();
|
||||||
foreach (var recipeData in RecipeData.GetAllRecipe())
|
foreach (var recipeData in RecipeData.GetAllRecipe())
|
||||||
{
|
{
|
||||||
|
|
@ -39,5 +40,7 @@ public class RecipeSelectDialog : MonoBehaviour
|
||||||
view.SetLockPanel(true);
|
view.SetLockPanel(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LayoutRebuilder.ForceRebuildLayoutImmediate(content);
|
||||||
|
scrollRect.verticalNormalizedPosition = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -654,6 +654,7 @@ GameObject:
|
||||||
- component: {fileID: 203586001}
|
- component: {fileID: 203586001}
|
||||||
- component: {fileID: 203586000}
|
- component: {fileID: 203586000}
|
||||||
- component: {fileID: 203585999}
|
- component: {fileID: 203585999}
|
||||||
|
- component: {fileID: 203586002}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Scroll View
|
m_Name: Scroll View
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -704,7 +705,7 @@ MonoBehaviour:
|
||||||
m_ScrollSensitivity: 1
|
m_ScrollSensitivity: 1
|
||||||
m_Viewport: {fileID: 25421135}
|
m_Viewport: {fileID: 25421135}
|
||||||
m_HorizontalScrollbar: {fileID: 0}
|
m_HorizontalScrollbar: {fileID: 0}
|
||||||
m_VerticalScrollbar: {fileID: 409545283}
|
m_VerticalScrollbar: {fileID: 0}
|
||||||
m_HorizontalScrollbarVisibility: 2
|
m_HorizontalScrollbarVisibility: 2
|
||||||
m_VerticalScrollbarVisibility: 0
|
m_VerticalScrollbarVisibility: 0
|
||||||
m_HorizontalScrollbarSpacing: -3
|
m_HorizontalScrollbarSpacing: -3
|
||||||
|
|
@ -749,6 +750,20 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 203585997}
|
m_GameObject: {fileID: 203585997}
|
||||||
m_CullTransparentMesh: 0
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!114 &203586002
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 203585997}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 4c7fb96966974f86a04af9747989d1f9, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
scrollRect: {fileID: 203585999}
|
||||||
|
verticalSlider: {fileID: 409545283}
|
||||||
--- !u!1 &277152052
|
--- !u!1 &277152052
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -914,7 +929,7 @@ MonoBehaviour:
|
||||||
m_GameObject: {fileID: 409545281}
|
m_GameObject: {fileID: 409545281}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, type: 3}
|
m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Navigation:
|
m_Navigation:
|
||||||
|
|
@ -944,12 +959,14 @@ MonoBehaviour:
|
||||||
m_SelectedTrigger: Selected
|
m_SelectedTrigger: Selected
|
||||||
m_DisabledTrigger: Disabled
|
m_DisabledTrigger: Disabled
|
||||||
m_Interactable: 1
|
m_Interactable: 1
|
||||||
m_TargetGraphic: {fileID: 2120123254}
|
m_TargetGraphic: {fileID: 409545284}
|
||||||
|
m_FillRect: {fileID: 0}
|
||||||
m_HandleRect: {fileID: 2120123253}
|
m_HandleRect: {fileID: 2120123253}
|
||||||
m_Direction: 2
|
m_Direction: 2
|
||||||
m_Value: 1
|
m_MinValue: 0
|
||||||
m_Size: 1
|
m_MaxValue: 1
|
||||||
m_NumberOfSteps: 0
|
m_WholeNumbers: 0
|
||||||
|
m_Value: 0
|
||||||
m_OnValueChanged:
|
m_OnValueChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
|
|
@ -2821,7 +2838,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 2154205f893c042a390e4b410b5b5ea5, type: 3}
|
m_Script: {fileID: 11500000, guid: 2154205f893c042a390e4b410b5b5ea5, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
content: {fileID: 28991871}
|
scrollRect: {fileID: 203585999}
|
||||||
recipePrefab: {fileID: 5490177795204899762, guid: 2beb2d436ad55734186e797d315796b3,
|
recipePrefab: {fileID: 5490177795204899762, guid: 2beb2d436ad55734186e797d315796b3,
|
||||||
type: 3}
|
type: 3}
|
||||||
closeButton: {fileID: 968322477}
|
closeButton: {fileID: 968322477}
|
||||||
|
|
@ -3652,7 +3669,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 0, y: 0}
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
m_AnchoredPosition: {x: 0, y: 127.75}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 52, y: 52}
|
m_SizeDelta: {x: 52, y: 52}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!114 &2120123254
|
--- !u!114 &2120123254
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue