試食ボタン無効時の表示修正
This commit is contained in:
parent
7b9b3d429f
commit
d98755bdaa
|
|
@ -183,6 +183,7 @@ public class ProductManagement : MonoBehaviour
|
|||
{
|
||||
Tasting(selectedTank.Value.num);
|
||||
tankList[selectedTank.Value.num - 1].SetData(gameData.StorageTanks[selectedTank.Value.num - 1]);
|
||||
SetActiveTastingButton(gameData.StorageTanks.Any(tank => !tank.IsEmpty));
|
||||
};
|
||||
LocalCacheManager.Save(TastingView.TastingDataTag, (selectedTank.AsObservable(), new Action(() => state.Value = ManagementState.None), tastingAction));
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Tasting);
|
||||
|
|
@ -245,14 +246,14 @@ public class ProductManagement : MonoBehaviour
|
|||
state.Value = ManagementState.None;
|
||||
}).AddTo(this);
|
||||
|
||||
var allTankStock = gameData.StorageTanks.Sum(x => x.Stock);
|
||||
tastingDisabledObject.SetActive(allTankStock == 0);
|
||||
tastingButton.interactable = allTankStock != 0;
|
||||
// 試食ボタン
|
||||
SetActiveTastingButton(gameData.StorageTanks.Any(tank => !tank.IsEmpty));
|
||||
tastingButton.OnClickAsObservable().Subscribe(_ =>
|
||||
{
|
||||
state.Value = ManagementState.Tasting;
|
||||
}).AddTo(this);
|
||||
|
||||
// 商品補充タイプ切替
|
||||
view.RefillType.Subscribe(mode =>
|
||||
{
|
||||
if (state.Value != ManagementState.Tasting)
|
||||
|
|
@ -265,6 +266,13 @@ public class ProductManagement : MonoBehaviour
|
|||
}).AddTo(this);
|
||||
}
|
||||
|
||||
private void SetActiveTastingButton(bool active)
|
||||
{
|
||||
tastingDisabledObject.SetActive(!active);
|
||||
tastingButton.gameObject.SetActive(active);
|
||||
tastingButton.interactable = active;
|
||||
}
|
||||
|
||||
private void ClearSelectedTank(List<ProductManagementTankView> tankList)
|
||||
{
|
||||
foreach (var tankView in tankList)
|
||||
|
|
|
|||
Loading…
Reference in New Issue